The International Simutrans Forum

 

Author Topic: Access charges not shown in line/convoy graphs  (Read 359 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2906
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Access charges not shown in line/convoy graphs
« on: January 22, 2020, 08:12:11 PM »
This is a followup for https://forum.simutrans.com/index.php/topic,19067.0.html
Now we have per km running costs and monthly maintenance added together and shown in line/convoy graphs. It would be even better if they are split, but it is acceptable to have them summed together. What would be more interesting is to see the access charges paid for usage of other players roads. So one could evaluate if it is worth using them.

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #1 on: January 29, 2020, 04:09:52 PM »
It is present in the standard but seems to have been removed in the past in extended.
Code: [Select]
enum convoi_cost_t { // Exp|Std|Description
CONVOI_CAPACITY = 0, //  0 | 0 | the amount of ware that could be transported, theoretically
CONVOI_TRANSPORTED_GOODS, //  1 | 1 | the amount of ware that has been transported
CONVOI_AVERAGE_SPEED, //  2 |   | the average speed of the convoy per rolling month
CONVOI_COMFORT, //  3 |   | the aggregate comfort rating of this convoy
CONVOI_REVENUE, //  4 | 2 | the income this CONVOI generated
CONVOI_OPERATIONS, //  5 | 3 | the cost of operations this CONVOI generated
CONVOI_PROFIT, //  6 | 4 | total profit of this convoi
CONVOI_DISTANCE, //  7 | 5 | total distance traveled this month
CONVOI_REFUNDS, //  8 |   | the refunds passengers waiting for this convoy (only when not attached to a line) have received.
// CONVOI_MAXSPEED, //    | 6 | average max. possible speed
// CONVOI_WAYTOLL, //    | 7 |
MAX_CONVOI_COST //  9 | 8 |
};

Code: [Select]
weg->get_owner()->book_toll_received( toll, get_schedule()->get_waytype() );
get_owner()->book_toll_paid(         -toll, get_schedule()->get_waytype() );
// book( -toll, CONVOI_WAYTOLL);
book( -toll, CONVOI_PROFIT);

Since refunds chart is probably never recorded since it was implemented, is it possible to replace Access charges or monthly maintenance?
I think it's easy to revive the waytoll record.
Either way, convoy's re-combination thinks these need to be reconfigured and may be a temporary measure.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19273
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Access charges not shown in line/convoy graphs
« Reply #2 on: January 29, 2020, 05:31:01 PM »
I do not think that we should abolish access charges or monthly maintenance. The refunds should be recorded and present - I am afraid that I do not remember why the access charges were commented out; they had been there in the past. They are potentially a useful thing to show.

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #3 on: January 29, 2020, 05:50:19 PM »
I apologize for my English ability.
I suggested that it be added rather than abolished. But I intended to say that it might be temporary.

The acceleration chart patch added two chart buttons. So adding another button does not increase the row (with default window size). Therefore, if there is no particular reason to abolish the waytoll, it is easy to resurrect it. Because the code seems to remain just commented out.

EDIT: I overlooked the row increase in linemanagement dialog (´・ω・`)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19273
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Access charges not shown in line/convoy graphs
« Reply #4 on: January 29, 2020, 05:55:21 PM »
I apologize for my English ability.
I suggested that it be added rather than abolished. But I intended to say that it might be temporary.

The acceleration chart patch added two chart buttons. So adding another button does not increase the row (with default window size). Therefore, if there is no particular reason to abolish the waytoll, it is easy to resurrect it. Because the code seems to remain just commented out.

Ahh, I understand! You mean for the convoy window, not the finances window? By all means, do add this; it may have been commented out because it worked on the basis of Standard's (very different) algorithm for calculating what this toll should be - Extended's algorithm uses a proportion of revenue as a toll for ways/ports/airports (the three are done differently), so you will need to make sure that the amounts recorded on this graph represent the actual amount paid by the convoy in question to other players for use of ways/ports/airports on the basis of the correct algorithm for each.

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #5 on: January 29, 2020, 06:01:37 PM »
You mean for the convoy window, not the finances window?
Yes. I think this thread is for that.

By all means, do add this; it may have been commented out because it worked on the basis of Standard's (very different) algorithm for calculating what this toll should be
I was not thinking about that possibility. First of all, I need to confirm how it works after removing the comment out.

EDIT:
Code: [Select]
weg->get_owner()->book_toll_received( toll, get_schedule()->get_waytype() );
get_owner()->book_toll_paid(         -toll, get_schedule()->get_waytype() );
// book( -toll, CONVOI_WAYTOLL);
At first glance, it appears that toll collection is currently taking place in the same part. Need further adjustments?
« Last Edit: January 29, 2020, 06:16:20 PM by Ranran »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19273
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Access charges not shown in line/convoy graphs
« Reply #6 on: January 29, 2020, 08:50:11 PM »
In Extended, things are more complex; there is an option to use the Standard-like fixed cost per tile of way system, which is what this code deals with. However, there is also an alternative system (which can be set by pakset authors) based on that used by the Railway Clearing House, in which the way owners receive a proportion of the income from the journey based on the proportion of the journey that they travelled on a foreign company's way.

I am not sure whether this latter type of toll is recorded in either of the methods set out above as it has been many years since I worked on this code; this would need some investigation to establish.

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #7 on: January 30, 2020, 10:18:39 AM »
Currently, it seems that waytoll has been subtracted from profit. So it just need to change that part to waytoll instead of profit.
I found it in three places in the code. Presumed to be where book_toll_paid() is called.
I changed the waytoll that had been deducted from profit to be separated from profit and recorded in waytoll.
It seems to be working properly. I confirmed on Bus, Rail, Ship, Airplane, but there is no inconsistency with  access charges chart on the financial dialog.


I have not yet added it to the linemanagement dialog. This adds a new row, as described above. (´・ω・`)
The orange color has the same color as "Total capacity" and "Scheduled" so needs to be changed.

Offline Phystam jp

  • *
  • Posts: 380
  • Pak256.Ex developer
    • Pak256 wiki page
  • Languages: JP, EN, EO
Re: Access charges not shown in line/convoy graphs
« Reply #8 on: January 30, 2020, 11:00:38 AM »
Can you add another column to show 'way toll' under the 'profit'? It would be very helpful.

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #9 on: January 30, 2020, 11:23:27 AM »
Can you add another column to show 'way toll' under the 'profit'?
(´・ω・`)どういう意味でおじゃる? What do you mean?

Offline Phystam jp

  • *
  • Posts: 380
  • Pak256.Ex developer
    • Pak256 wiki page
  • Languages: JP, EN, EO
Re: Access charges not shown in line/convoy graphs
« Reply #10 on: January 30, 2020, 01:06:22 PM »
利益: 〜€ の下に
支払った通行料: 〜€
 の列を付け加えるにゃ!
add Way toll: 〜€ line
under Profit: 〜€
Nya!

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #11 on: January 30, 2020, 03:48:59 PM »
(´・ω・`)無茶な注文でおじゃ
Columns are not fixed. Flexible. Try changing the size of the window. They are arranged in the order in which they are recorded.

Offline Phystam jp

  • *
  • Posts: 380
  • Pak256.Ex developer
    • Pak256 wiki page
  • Languages: JP, EN, EO
Re: Access charges not shown in line/convoy graphs
« Reply #12 on: January 30, 2020, 04:30:11 PM »
I mean...

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #13 on: January 30, 2020, 05:15:25 PM »
Well, I misunderstood your request.
But I don't think estimated toll information can be displayed there. As James explains, the method of collecting tolls is complex in extended, varies by waytype, and depends on fare revenue. Therefore we do not know the amount to be collected in advance. For example, how much is not fixed per tile. Fo rexample, if the passenger is 0, toll will be 0. Also we do not know toll while driving. Toll is calculated when convoy stop at the station and unload them and get income.
There are also options for such collection settings.
Even for options that depend on running costs, it is not always collected, depending on the tiles that pass.
« Last Edit: January 30, 2020, 05:25:42 PM by Ranran »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 19273
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Access charges not shown in line/convoy graphs
« Reply #14 on: January 30, 2020, 06:46:34 PM »
I agree that the toll cannot sensibly be predicted. However, actual tolls should be taken into account when calculating profit, and should be counted as negative on the profit graph, as with all other expenses.

Offline Ranran jp

  • *
  • Posts: 659
  • Languages: ja
Re: Access charges not shown in line/convoy graphs
« Reply #15 on: January 30, 2020, 06:53:12 PM »
Ahh, It is necessary to subtract toll from the profit of convoy information after this change. I would have to do it.
My misunderstanding. There was no need to deduct from Profit record. I will fix this.