chrsmithdemos / switchlist

Automatically exported from code.google.com/p/switchlist
0 stars 0 forks source link

Add maximum train size #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some users would like to set maximum train lengths so that the layout does not 
get overwhelmed when random chance or cargo settings send too many cars to one 
location.

There should be a maximum train length that the code for assigning freight cars 
to trains would respect.

Original issue reported on code.google.com by rwbowdi...@gmail.com on 23 Apr 2011 at 5:42

GoogleCodeExporter commented 9 years ago
High priority, often requested.

Original comment by rwbowdi...@gmail.com on 24 Apr 2011 at 5:31

GoogleCodeExporter commented 9 years ago

Original comment by rwbowdi...@gmail.com on 21 Jun 2011 at 7:13

GoogleCodeExporter commented 9 years ago
The check for max train length needs to be done when assigning cars (so cars 
have a chance to be assigned elsewhere).  Algorithm will need to keep track of 
the number of cars added and subtracted at each station so it can tell when the 
between-station train length would be too long.

Potential implementation: keep an array of length [number of station stops], 
and mark the number of cars that are added and removed at each station.  When a 
station appears twice, we can either add at beginning and remove at end (must 
be done for first and last stop), or all switching can be assumed to be done at 
first occurrence.

For extra credit, go through cars in order of popularity of pick up / drop off 
station so that cars only picked up by one train aren't dumped because too many 
cars were added at a station served by other trains.

Original comment by rwbowdi...@gmail.com on 18 Feb 2012 at 5:31

GoogleCodeExporter commented 9 years ago
In revision 257.

Original comment by rwbowdi...@gmail.com on 12 Mar 2012 at 2:32