News:

SimuTranslator
Make Simutrans speak your language.

Web calculator for Standard cargo revenue (speed bonus, 12.5% floor), corrections welcome

Started by yulorien, Yesterday at 10:38:27 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

yulorien

I built a browser calculator for per-trip cargo revenue in Simutrans-Standard (124.x / 125.x), and I would like people who know the formula better than I do to check it.

It follows ware_t::calc_revenue plus the (x + 1500) / 3000 conversion in the vehicle code:

kmh_base = floor(100 * convoy_kmh / ref_kmh) - 100
bonus    = max(125, 1000 + kmh_base * speed_bonus)
revenue  = floor((value * bonus * distance * amount + 1500) / 3000)

Inputs: pakset (Pak128, Pak64, Pak128.German), cargo, way type, year, convoy speed (the profit speed from the convoy window), Manhattan distance between halts, amount, trips per month. Output: revenue per trip and per month, the speed bonus in percent, a warning when the 12.5% floor applies, and a table of every cargo in the pakset sorted by revenue per unit per tile at your speed.

Worked example: Pak128 cars (value 170, speed_bonus 15), track in 2000 (ref 160 km/h), convoy at 200 km/h, 100 tiles, 50 cars. kmh_base = 25, bonus = 1375, revenue = floor((170 * 1375 * 100 * 50 + 1500) / 3000) = 389,583.

ref_kmh is interpolated between speedbonus.tab points the way vehicle_builder_t::get_speedbonus does it, for January of the year you enter; in-game it keeps creeping month by month, so later in a mid-curve year it reads a little higher. Standard only, no Extended. Running costs and maintenance are not modelled. The pakset tables were transcribed by hand.

It is a Simutrans cargo revenue calculator on my site, smart-calculators.net, which carries ads. If a value or curve is wrong, tell me which and I will fix it.