diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index b11bac577b4..93b44562a29 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -100,7 +100,8 @@ beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = "doubl 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.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.maxSearchRadius = "double | 8046.72" +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 don't strand our drivers in an oasis #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 7b3f4db4d8b..eeb965ccfb5 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -26,15 +26,16 @@ class ZonalParkingManager( parkingZones: Array[ParkingZone], zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[TAZ], rand: Random, + minSearchRadius: Double, maxSearchRadius: Double, boundingBox: Envelope, mnlMultiplierParameters: ParkingMNL.ParkingMNLConfig ) extends Actor with ActorLogging { - if (maxSearchRadius < ZonalParkingManager.MinSearchRadius) { + if (maxSearchRadius < minSearchRadius) { log.warning( - s"maxSearchRadius of $maxSearchRadius meters provided from config is less than the fixed minimum search radius of ${ZonalParkingManager.MinSearchRadius}; no searches will occur with these settings." + s"maxSearchRadius of $maxSearchRadius meters provided from config is less than the fixed minimum search radius of ${minSearchRadius}; no searches will occur with these settings." ) } @@ -43,7 +44,7 @@ class ZonalParkingManager( val parkingZoneSearchConfiguration: ParkingZoneSearchConfiguration = ParkingZoneSearchConfiguration( - ZonalParkingManager.MinSearchRadius, + minSearchRadius, maxSearchRadius, boundingBox, geo.distUTMInMeters @@ -274,7 +275,6 @@ object ZonalParkingManager extends LazyLogging { // this number should be less than the MaxSearchRadius config value, tuned to being // slightly less than the average distance between TAZ centroids. - val MinSearchRadius: Double = 1000.0 val AveragePersonWalkingSpeed: Double = 1.4 // in m/s val HourInSeconds: Int = 3600 @@ -296,6 +296,7 @@ object ZonalParkingManager extends LazyLogging { val parkingFilePath: String = beamConfig.beam.agentsim.taz.parkingFilePath val parkingStallCountScalingFactor = beamConfig.beam.agentsim.taz.parkingStallCountScalingFactor val parkingCostScalingFactor = beamConfig.beam.agentsim.taz.parkingCostScalingFactor + val minSearchRadius = beamConfig.beam.agentsim.agents.parking.minSearchRadius val maxSearchRadius = beamConfig.beam.agentsim.agents.parking.maxSearchRadius val mnlParamsFromConfig = beamConfig.beam.agentsim.agents.parking.mulitnomialLogit.params // distance to walk to the destination @@ -339,6 +340,7 @@ object ZonalParkingManager extends LazyLogging { stalls, searchTree, random, + minSearchRadius, maxSearchRadius, boundingBox, mnlMultiplierParameters @@ -358,6 +360,7 @@ object ZonalParkingManager extends LazyLogging { tazTreeMap: TAZTreeMap, geo: GeoUtils, random: Random, + minSearchRadius: Double, maxSearchRadius: Double, boundingBox: Envelope, includesHeader: Boolean = true @@ -369,6 +372,7 @@ object ZonalParkingManager extends LazyLogging { parking.zones, parking.tree, random, + minSearchRadius, maxSearchRadius, boundingBox, ParkingMNL.DefaultMNLParameters diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 9637baa5b4f..5afc96930af 100755 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1,4 +1,4 @@ -// generated by tscfg 0.9.4 on Mon Aug 26 14:38:09 MDT 2019 +// generated by tscfg 0.9.4 on Mon Aug 26 21:00:03 MDT 2019 // source: src/main/resources/beam-template.conf package beam.sim.config @@ -589,6 +589,7 @@ object BeamConfig { case class Parking( maxSearchRadius: scala.Double, + minSearchRadius: scala.Double, mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, rangeAnxietyBuffer: scala.Double ) @@ -639,6 +640,7 @@ object BeamConfig { 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{}") diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index 811442c1bc0..370536f2c01 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -280,6 +280,7 @@ object ZonalParkingManagerSpec { boundingBox: Envelope, random: Random = Random )(implicit system: ActorSystem): ActorRef = { + val minSearchRadius = 1000.0 val maxSearchRadius = 16093.4 // meters, aka 10 miles val zonalParkingManagerProps = Props( ZonalParkingManager( @@ -287,6 +288,7 @@ object ZonalParkingManagerSpec { tazTreeMap, geo, random, + minSearchRadius, maxSearchRadius, boundingBox )