Skip to content

Instantly share code, notes, and snippets.

@compwron
Last active December 19, 2015 12:18
Show Gist options
  • Save compwron/5953652 to your computer and use it in GitHub Desktop.
Save compwron/5953652 to your computer and use it in GitHub Desktop.
Idle speculation on what the break-even rate for a cab ride is
cab_driver_pay_per_hour = 8
average_cab_drivers_on_duty_per_hour = 100
dispatcher_pay_per_hour = 10
average_cab_driver_hours_worked_per_day = 10
cab_drivers_per_dispatcher = 50
average_miles_per_gallon = 30
average_miles_per_trip = 5
average_trip_duration = 20 # minutes
average_miles_per_minute = 30
hours_in_day = 24
gas_price_per_gallon = 3.75
percentage_of_drivers_on_trips = 0.50
average_trips_per_hour_per_driver = 4
monthly_rent_for_dispatcher_office = 500 #
average_days_in_month = 30
daily_rent_for_dispatcher_office = monthly_rent_for_dispatcher_office / average_days_in_month
average_trips_per_day_for_driver = average_cab_driver_hours_worked_per_day * average_trips_per_hour_per_driver
payroll_per_hour = cab_driver_pay_per_hour + (dispatcher_pay_per_hour * average_cab_drivers_on_duty_per_hour/cab_drivers_per_dispatcher) + daily_rent_for_dispatcher_office/hours_in_day
miles_driven_per_day = average_cab_drivers_on_duty_per_hour * percentage_of_drivers_on_trips * average_miles_per_trip * average_trips_per_day_for_driver
gas_per_hour = gas_price_per_gallon * miles_driven_per_day / hours_in_day
average_miles_per_day = average_cab_drivers_on_duty_per_hour * average_trips_per_day_for_driver * average_miles_per_trip
cab_company_outlay_per_day = hours_in_day * (payroll_per_hour + gas_per_hour)
miles_in_current_trip = ARGV[0].to_i
breaking_even_trip_price = (cab_company_outlay_per_day / average_miles_per_day) * miles_in_current_trip
puts breaking_even_trip_price
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment