# Vehicle Groups: parent group should count total number of vehicles in subgroups #6189

Closed
opened this issue Dec 26, 2014 · 6 comments
Closed

# Vehicle Groups: parent group should count total number of vehicles in subgroups#6189

opened this issue Dec 26, 2014 · 6 comments
Labels

### DorpsGek commented Dec 26, 2014

2006TTD opened the ticket and wrote:

For ease of discussion I attached a screenshot showing a sample multi-level vehicle group.

First, I understand that in "Level 2" the grayed out entries are those that belong to the subgroups, this has no problem.

However, the number of vehicles shown on the left panel (i.e. the column at which the yellow arrow is pointing) may be confusing.
"Level 2" is displaying the figure of 1 - one vehicle which is in the group, but not in any of the subgroups, but some may be thinking it should be displaying 1+1+3+4+0 = 9

A similar problem is also seen in "2A", it may be debatable on whether it should be 1 or 1+3+4 = 8

To tackle this problem, there may be three solutions:
(1) Leave it as it is and add to the documentation that the numbers are meant for the vehicles that belong to that group at that level exclusively, but that is not very reasonable as many would expect a sum of the group and the subgroups from a mathematical perspective.

(2) Display the total number of vehicles in that group and subgroups
i.e. Level 1 would show 0+2+1+2 = 5; Level 2 showing 9; 2A showing 8 and so on.

(3) Display both figures in the form
(Number of vehicles in group only) / (Total number of vehicles in group and subgroups)
i.e. Level 1 would show 0/5; Level 2 showing 1/9; 2A showing 1/8 and so on.

Attachments

Reported version: trunk
Operating system: All

### DorpsGek commented Aug 17, 2017

andythenorth wrote:

In my experience (YMMV), hierarchies like the group hierarchy show a total per node based on the contents of all child nodes, not just on the contents of the node.

TL:DR; it should sum the subgroups.

### DorpsGek commented Aug 17, 2017

3298 wrote:

Ah, you found the correct ticket for that preparatory patch I posted over at #6053. I must've missed it. Thanks, Andy! :)

The patch implements solution 2 - with collapsed subgroups solution 1 is even more counterintuitive than now.
Solution 3 never occurred to me, but reading it now I find it intriguing. Though I'd change the format to "only_this_group (+sum_of_subgroups)" to avoid ambiguity. Opinions?

### DorpsGek commented Oct 5, 2017

2006TTD wrote:

Just caught up with this today. I would agree that using parentheses is clearer than the / symbol proposed previously.

###### This comment was imported from FlySpray: https://bugs.openttd.org/task/6189#comment14778
mentioned this issue Apr 7, 2018

### andythenorth commented Apr 13, 2018 • edited by TrueBrain

 3298 has stopped working on this. https://www.tt-forums.net/viewtopic.php?f=33&t=83025 I do think it's a legit improvement.
removed the label Apr 13, 2018

### TrueBrain commented Apr 13, 2018

 I even consider this a bug; it is very not-what-you-expect!
added the label Jan 5, 2019
removed the label Jan 24, 2019
mentioned this issue Jan 27, 2019

### stale bot commented Mar 25, 2019

 This issue has been automatically marked as stale because it has not had any activity in the last two months. If you believe the issue is still relevant, please test on the latest nightly and report back. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.
bot added the label Mar 25, 2019
added a commit to LordAro/OpenTTD that referenced this issue Mar 26, 2019
``` Add OpenTTD#6189: Groups now count the total number of vehicles in su… ```
``` 9ebfa7f ```
`…bgroups (3298)`
added a commit to LordAro/OpenTTD that referenced this issue Mar 26, 2019
``` Add OpenTTD#6189: Groups now count the total number of vehicles in su… ```
``` 5e315b4 ```
`…bgroups (3298)`
added a commit to LordAro/OpenTTD that referenced this issue Mar 26, 2019
``` Add OpenTTD#6189: Groups now count the total number of vehicles in su… ```
``` 44cb83c ```
`…bgroups (3298)`
mentioned this issue Mar 27, 2019
closed this in #7417 Mar 27, 2019
added a commit that referenced this issue Mar 27, 2019
``` Add #6189: Groups now count the total number of vehicles in subgroups… ```
``` 8890436 ```
`… (3298)`