-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jl/update ridehail surge #3740
base: develop
Are you sure you want to change the base?
Jl/update ridehail surge #3740
Conversation
…only to multiplier on total ridehail fare
… with rideHailSurgePricingManagers map
…iple instances of each; updated output Filenames with rhm names
…-surge # Conflicts: # src/main/scala/beam/router/skim/SkimsUtils.scala # src/main/scala/beam/router/skim/readonly/ODSkims.scala
@@ -27,7 +27,7 @@ public class RideHailRevenueAnalysis implements ControlerListener, IterationEnds | |||
private final Logger log = LoggerFactory.getLogger(RideHailRevenueAnalysis.class); | |||
|
|||
private final RideHailSurgePricingManager surgePricingManager; | |||
static final String fileBaseName = "rideHailRevenue"; | |||
static final String fileBaseName = "rideHailRevenue_%s"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid putting formatting into the variable, instead let's use it in the string.format method directly, this will improve readability
class RideHailSurgePricingManager @Inject() ( | ||
val beamConfig: BeamConfig, | ||
val beamScenario: BeamScenario, | ||
val managerName: String | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using constant link to beamConfig will prevent automatic updates of config in case it was changed during a simulation, instead it is better to get the latest version of config from the beamServices object each time or manually subscribe to changes of beamConfig and updating it each time.
There is the same issue for the any config values that are stored in variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The issue here is that beamServices is initialized after RideHailSurgePricingManager. And since I am initializing a map of multiple RideHailSurgePricingManager objects, I needed to actually initialize each one, which would error without access to beamServices. @nikolayilyin do you have any suggestions for alternative approaches?
Updating surge pricing to work for multiple ridehail managers.