Transport Fever

Transport Fever

Otillräckligt med betyg
Best Timing To Do Replacements
Av 榴槤西米露
Automatic replacements in this game have several options of percentages of lifespan to choose, which one minimizes the cost?
I tried to figure out the cost and the value function according to time, with which, we could calculate the best timing to do replacements.
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
TL;DR


With the two formulas above, we can see that, for vehicles with 15, 20, 30, 40, 50 years lifespan, the best timing is at year 14, 14, 13, 10, 6 respectively.
Luckily, it costs just slightly more even if you do replacements all at 100% lifespan. Specifically, ~0.01%, ~0.2%, ~0.7%, ~1.2%, ~1.6% more of the vehicle price every year.
If you replace them at 25% lifespan, it's ~0.05% more of the vehicle price for a 50-year one, which is only 2.16K per year for a standard TGV.
How did you get it?
The formulas above don't have to be accurate (while they look so beautiful that I believe they should be), I fitted them from data I observed in game, so I'm telling you how I got this and you can also examine the process.

First, a few facts.
1. Vehicle value shrinks and cost rises with time;
2. Vehicle value changes monthly, while cost changes yearly;
3. Numbers in game are rounded to the third digit, which means, if you see a vehicle costs 1.55M, the precise number can be any number between 1.545M and 1.555M.

Data we can get.
1. Vehicle initial price and yearly cost, you can see these in a depot;
2. Vehicle current value and cost, in vehicle details;
3. Vehicle monthly cost, it bubbles up in red every first day of a month.
3 is duplicate, but (usually) with more precision, for example, let's say monthly cost is 203, then yearly cost should be 203*12, which is 2436, and 2436 will be rounded to 2.43K in game.
Value Function
I started with horse cart, that's what I could get when I had the idea.

I monitored several carts and recorded the data every month, the results are below.


The curve plummets faster along with time, so I just guessed it's an exponential function. Given every value lies exactly in an interval [v-0.05, v+0.05), we can estimate the base of the exponential function must be in [0.9916760, 0.9916553]. It's a valid interval, suggesting there's really a chance. I tried to fractionize it, and the first in this interval, if sorted ascendingly by denominator, gives 119/120. (the next is 832/839)

I had done the same thing to horse wagon in train fever a few days ago but hadn't gone further (I don't have transport fever 2 and just switched to transport fever not long ago), so I dug the data out to check whether my formula fits it too.

The base fits in [0.9888809, 0.9889015], and the first fraction is 89/90, the next is 891/901.

Notice that horse cart and horse wagon have different lifespans, 15 and 20 years respectively, and are proportional to the denominators, we can now summarise the formula

Yeah, just the second one.

I examined the formula with some other trains, buses, ships and they all fit it perfectly.
Cost Function


Above is the data I recorded.

At first glance, I thought it should be a parabola, but failed to fit one, until I by accident found the proportion between vehicle (year 0) price and cost. It's 6:1.

From the experience of value function, it seems no too many magic numbers in this game's machenics. And I looked at the cost at year 15 (which is horse wagon's lifespan), it's 1/4 the price.

Now you can guess the answer.



I checked some other vehicles, it's correct.
Conclusion: Best Replacement Time
For early buses/trucks, it's almost perfect to replace when they reach their lifespan. For those with longer lifespans, you may want to change them more frequently.

For example, a Re 4/4 locomotive, whose lifespan is 55 years, need replacement every 3 years to minimize the cost, which I feel is not practical. I would rather automatically replace one at 25% lifespan, which would cost ~5k more every year. You can even stick to an 100% lifespan replacement for everything, sparing yourself from remembering these numbers. That costs you ~86k more for a Re 4/4 every year. It's really not much, compared to it's regular 800k cost, plus when you can afford it, you don't really care about some 100k revenue.

Full result is here[drive.google.com].
Discussion
In the whole calculation, I only dealt with average cost. It might not be THE BEST, like, you might regard late replacements as a "loan", there are also many other issues that matter.

I did some googling and found a similar work on reddit. It's a splendid work but I believe mine is more accurate. :)
According to the comments there, the curve plateaus after a certain time. My current experiments haven't taken that long run into account, and I will update this guide when I have results.

Feel free to comment if you find any mistakes or have any suggestions. :)