News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Max income

Started by Ters, October 07, 2012, 03:57:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ters

I've been looking at the max income listed at each vehicle in the convoy details window lately, and I've noted that the numbers seem to change both up and down as a train is running. What is the input for calculating this number? If it takes the actual track ahead as input, does it only look up to the next waypoint?

Dwachs

This maximum is an upper bound on the income the train can generate on its current trip. Takes into account speedbonus. It does not know anything about how many tiles left until target.

See gui/convoi_detail_t.cc line 306+
Parsley, sage, rosemary, and maggikraut.

Ters

Comparing convoi_detail_t.cc to simvehikel.cc, doesn't the former lack a division by three?

Dwachs

Quote from: Ters on October 15, 2012, 10:57:45 AM
Comparing convoi_detail_t.cc to simvehikel.cc, doesn't the former lack a division by three?
convoi_detail_t.cc line 309 divides by 3.000 as it is done in vehikel_t::calc_gewinn.

Imho the formula in convoi-detail is correct. Since it is missing anything about distance, the 'max income' is actually maximal income of full vehicle per tile travelled.
Parsley, sage, rosemary, and maggikraut.

Ters

#4
Somehow I did not see it. I probably wasn't looking careful enough, since I had a reason to believe it was missing. That means I have to reopen my investigation into why my calculations give one third of the max income (actually, it's max profit) listed in the convoy details in the game.

EDIT: Perhaps this should be moved somewhere more appropriate. It has taken a rather technical turn.