From: Stefan F. <ste...@we...> - 2010-04-19 20:01:25
Attachments:
revenue_statistics.txt
|
Hi Alex, I have attached a document that contains the detailed numbers for several train combinations without and with the revenue prediction active. The following figures are defined: revenue evaluation: how often the revenue of all trains is evaluated edges travelled: how many edges were followed during the search predictions: how often the potential maximum revenue was predicted. My desktop is even slower as my laptop, as it is slightly older and has an AMD processor. It clearly shows that revenue predictions is strongest for train combinations and non-diesel trains. Running a diesel alone is not any faster, unless an optimal solution is found (early). Stefan I sent that to the develop list, as others might also be interested in those numbers. I extract the main figures below, all runs on the test scenario A. 8 train alone: without prediction: 3.8k evaluations, 16.4k edges, time: < 1 sec with prediction: 62 evaluations, 858 predictions, 2.3k edges, < 1 sec 8 and 10 trains: without prediction: 1.9M evaluations, 11.0M edges, time: 90 sec with prediction: 25k evaluations, 143k predictions, 387k edges, time: 4 sec This clearly shows the strong increase of possible solutions, if more than one train is involved. It is around 1:500! Diesel train: without prediction: 424k evaluations, 3.3M edges, time: 25 sec with prediction: 335k evaluations, 753k predictions, 2.6M edges, time: 23 sec (In this example an optimal solution is found, but late). A diesel is less complicated than the combination of an 8 and 10, but the revenue prediction does no help. Diesel and a 6 train: without prediction: 7.3M evaluations, 52.5M edges, time: 480 sec with prediction: 231k evaluations, 2.8M predictions, 6.2M edges, time: 56 sec Adding a 6 train, increases the running time by 20 without prediction, but only a little more than doubles with prediction. On Sunday 18 April 2010 17:44:04 you wrote: > Hi Stefan, > > I would agree about the name of the first number. > > (1) should be ok, I do the same, and there is no good reason for the > algorithm to try evaluating route that just extend already evaluated route > by some stations the train can't reach anyway. Or we could run the test on > "express" train that can skip anything. Express trains (or any train > capable of skipping cities) actually make me wonder what are possible > rules about visiting the same hex. In some games train is not allowed to > visit the same hex twice (when there are 2 separate cities on the tile). > If there is any game with this rule and with express trains, then there's > a question - if the train skips one city in the hex and counts another - > is it valid route? > > (2) I apply the same method to the routes, but I didn't evaluate "half" > routes - I only evaluate complete route (consisting of those 2 parts). How > can you do differently? - There might be bonus for visiting 2 cities in > different halves, or something like east-west run. > > If it's difficult to extract this number from your code now, we could set > up example with the station in the dead-end, so there's only one way to > leave it. > > Number of segments is relevant to the two-phased approach only. It is > number of edges in the "coarse" graph (which is the same as number of > distinct ways to travel between any pair of cities). You were asking about > this number earlier to evaluate amount of memory that would need to be > stored. > > I've also done profiling and it appears that storing segment exclusions as > a vector of segments excluded by each segment is fine - this is not a > bottleneck. So I haven't tried 2D array of booleans approach. But maybe I > should try some different cases (for example set of 4 trains (2,2,3 and 3) > - that may have a bottleneck in different places comparing to the case of > few long trains). > > Thanks, > Alex. > > On Sun, 18 Apr 2010 13:28:24 -0600, Stefan Frey <ste...@we...> wrote: > > Hi Alex, > > I would call the first statistic "number of route evaluations" and it > > counts > > every call to the evaluation function. This figure is also available for > > multiple-train runs. If we have the same number, it is almost sure that > > the > > two algorithms work identical. If not, it proves nothing, see below. > > > > Potential problems: > > 1) I terminate trains as soon as possible, thus numbers depend on the > > sequence > > of vertexes visited. > > > > 2) I have train runs divided in two half trains: First the head train > > starts > > and each station the train can return to its start token and then the > > bottom > > train runs. To avoid duplication of routes (due to symmetry) the bottom > > train > > can only start to the side with increased orientation. If I remember > > that is > > a different approach to yours. > > > > So if we want to compare figures we have to run a train with infinite > > length > > (to avoid termination) and is not allowed to run twice from the start > > vertex. > > > > I will have to adjust my codes to accommodate for such a test. > > > > The other statistic I am not fully clear about: Wat is exactly the > > number of > > segments? If this is related to the two-phase approach I assume this is > > the > > maximum number of connections between two stations on the map? > > And I guess, that this might be the answer to the unrelated question I > > raised > > before. This strengthens the case of your approach. I will implement it > > as > > soon as I have some time left, which will be most likely after the next > > release. > > > > Stefan > > > > On Sunday 18 April 2010 06:34:51 you wrote: > >> Hi Stefan, > >> > >> I thought it might be useful to compare how many routes we try during > >> the > >> complete route search. We should be getting the same number. If we are > >> not > >> it will indicate that one of us (or both) have a bug. I suppose to test > >> it > >> we would need to run a single sufficiently long train (or maybe try for > >> various train lengths) on the same track. > >> > >> I've also checked on number of segments in two-phased approach. In the > >> scenario B there are just 153 segments. > >> > >> Thanks, > >> Alex. |
From: alexti <al...@sh...> - 2010-04-20 04:49:42
|
Hi Stefan, Here are my numbers. It's pointless to compare edges, because I'm using 2-phased approach, so I'm only giving number of revenue evaluations. I also assume that you're talking about 10+8 when you say "10+6" (that seems obvious from the attached stats). The good news is that the optimal revenue we're getting is identical in all cases. The bad news is that everything else is different. I have much higher number of revenue evaluation. I suspect that I evaluate something unnecessary (considering that I never find any better route :) ). That's not necessarily bad - perhaps if I get rid of it I can compute things faster. It's interesting that none of our methods is good for diesel plus other train. What's worse, I think that this time can deteriorate dramatically on the examples with more cities. The root of the problem is that there might be a lot of different diesel routes with very small value variation (like within 10-30$) which would mean that in each case the remaining graph will have to be evaluated for the 8 train... Btw, in what order do you iterate over trains? I go from longest to shortest. On some earlier tests I've decided that it worked better, but now I wonder if the diesel case might be an exception... 8 - 5601, 0.003s D - 957676, 1.4s 10+8 - 3649238, 5.8s D+8 - 16110745, 74.5s Thanks, Alex. On Mon, 19 Apr 2010 14:01:14 -0600, Stefan Frey <ste...@we...> wrote: > Hi Alex, > I have attached a document that contains the detailed numbers for several > train combinations without and with the revenue prediction active. > > The following figures are defined: > revenue evaluation: how often the revenue of all trains is evaluated > edges travelled: how many edges were followed during the search > predictions: how often the potential maximum revenue was predicted. > > My desktop is even slower as my laptop, as it is slightly older and has > an AMD > processor. > > It clearly shows that revenue predictions is strongest for train > combinations > and non-diesel trains. Running a diesel alone is not any faster, unless > an > optimal solution is found (early). > > Stefan > > I sent that to the develop list, as others might also be interested in > those > numbers. I extract the main figures below, > all runs on the test scenario A. > > 8 train alone: > without prediction: 3.8k evaluations, 16.4k edges, time: < 1 sec > with prediction: 62 evaluations, 858 predictions, 2.3k edges, < 1 sec > > 8 and 10 trains: > without prediction: 1.9M evaluations, 11.0M edges, time: 90 sec > with prediction: 25k evaluations, 143k predictions, 387k edges, time: 4 > sec > > This clearly shows the strong increase of possible solutions, if more > than one > train is involved. It is around 1:500! > > Diesel train: > without prediction: 424k evaluations, 3.3M edges, time: 25 sec > with prediction: 335k evaluations, 753k predictions, 2.6M edges, time: > 23 sec > (In this example an optimal solution is found, but late). > > A diesel is less complicated than the combination of an 8 and 10, but the > revenue prediction does no help. > > Diesel and a 6 train: > without prediction: 7.3M evaluations, 52.5M edges, time: 480 sec > with prediction: 231k evaluations, 2.8M predictions, 6.2M edges, time: > 56 sec > > Adding a 6 train, increases the running time by 20 without prediction, > but > only a little more than doubles with prediction. > > > > On Sunday 18 April 2010 17:44:04 you wrote: >> Hi Stefan, >> >> I would agree about the name of the first number. >> >> (1) should be ok, I do the same, and there is no good reason for the >> algorithm to try evaluating route that just extend already evaluated >> route >> by some stations the train can't reach anyway. Or we could run the test >> on >> "express" train that can skip anything. Express trains (or any train >> capable of skipping cities) actually make me wonder what are possible >> rules about visiting the same hex. In some games train is not allowed to >> visit the same hex twice (when there are 2 separate cities on the tile). >> If there is any game with this rule and with express trains, then >> there's >> a question - if the train skips one city in the hex and counts another - >> is it valid route? >> >> (2) I apply the same method to the routes, but I didn't evaluate "half" >> routes - I only evaluate complete route (consisting of those 2 parts). >> How >> can you do differently? - There might be bonus for visiting 2 cities in >> different halves, or something like east-west run. >> >> If it's difficult to extract this number from your code now, we could >> set >> up example with the station in the dead-end, so there's only one way to >> leave it. >> >> Number of segments is relevant to the two-phased approach only. It is >> number of edges in the "coarse" graph (which is the same as number of >> distinct ways to travel between any pair of cities). You were asking >> about >> this number earlier to evaluate amount of memory that would need to be >> stored. >> >> I've also done profiling and it appears that storing segment exclusions >> as >> a vector of segments excluded by each segment is fine - this is not a >> bottleneck. So I haven't tried 2D array of booleans approach. But maybe >> I >> should try some different cases (for example set of 4 trains (2,2,3 and >> 3) >> - that may have a bottleneck in different places comparing to the case >> of >> few long trains). >> >> Thanks, >> Alex. >> >> On Sun, 18 Apr 2010 13:28:24 -0600, Stefan Frey <ste...@we...> >> wrote: >> > Hi Alex, >> > I would call the first statistic "number of route evaluations" and it >> > counts >> > every call to the evaluation function. This figure is also available >> for >> > multiple-train runs. If we have the same number, it is almost sure >> that >> > the >> > two algorithms work identical. If not, it proves nothing, see below. >> > >> > Potential problems: >> > 1) I terminate trains as soon as possible, thus numbers depend on the >> > sequence >> > of vertexes visited. >> > >> > 2) I have train runs divided in two half trains: First the head train >> > starts >> > and each station the train can return to its start token and then the >> > bottom >> > train runs. To avoid duplication of routes (due to symmetry) the >> bottom >> > train >> > can only start to the side with increased orientation. If I remember >> > that is >> > a different approach to yours. >> > >> > So if we want to compare figures we have to run a train with infinite >> > length >> > (to avoid termination) and is not allowed to run twice from the start >> > vertex. >> > >> > I will have to adjust my codes to accommodate for such a test. >> > >> > The other statistic I am not fully clear about: Wat is exactly the >> > number of >> > segments? If this is related to the two-phase approach I assume this >> is >> > the >> > maximum number of connections between two stations on the map? >> > And I guess, that this might be the answer to the unrelated question I >> > raised >> > before. This strengthens the case of your approach. I will implement >> it >> > as >> > soon as I have some time left, which will be most likely after the >> next >> > release. >> > >> > Stefan >> > >> > On Sunday 18 April 2010 06:34:51 you wrote: >> >> Hi Stefan, >> >> >> >> I thought it might be useful to compare how many routes we try during >> >> the >> >> complete route search. We should be getting the same number. If we >> are >> >> not >> >> it will indicate that one of us (or both) have a bug. I suppose to >> test >> >> it >> >> we would need to run a single sufficiently long train (or maybe try >> for >> >> various train lengths) on the same track. >> >> >> >> I've also checked on number of segments in two-phased approach. In >> the >> >> scenario B there are just 153 segments. >> >> >> >> Thanks, >> >> Alex. > |
From: alexti <al...@sh...> - 2010-04-20 05:11:37
|
I've figured I could do a quick experiment and change the order of train iteration. So here are new results: 8+10 - 3649121, 4.5s 8+D - 16097719, 22.7s 8+D case is much faster now and 8+10 is slightly faster. I am not sure I understand this result - number of evaluations is nearly identical (I am not entirely sure if it's supposed to be identical or not and anyway I don't trust my ability to calculate each route only once :) ). So why the time went down? Besides, I expected this swap to improve diesel case, but 8+10 being faster than 10+8 surprises me... On Mon, 19 Apr 2010 22:49:51 -0600, alexti <al...@sh...> wrote: > Hi Stefan, > > Here are my numbers. It's pointless to compare edges, because I'm using > 2-phased approach, so I'm only giving number of revenue evaluations. I > also assume that you're talking about 10+8 when you say "10+6" (that > seems > obvious from the attached stats). The good news is that the optimal > revenue we're getting is identical in all cases. The bad news is that > everything else is different. I have much higher number of revenue > evaluation. I suspect that I evaluate something unnecessary (considering > that I never find any better route :) ). That's not necessarily bad - > perhaps if I get rid of it I can compute things faster. It's interesting > that none of our methods is good for diesel plus other train. What's > worse, I think that this time can deteriorate dramatically on the > examples > with more cities. The root of the problem is that there might be a lot of > different diesel routes with very small value variation (like within > 10-30$) which would mean that in each case the remaining graph will have > to be evaluated for the 8 train... > > Btw, in what order do you iterate over trains? I go from longest to > shortest. On some earlier tests I've decided that it worked better, but > now I wonder if the diesel case might be an exception... > > 8 - 5601, 0.003s > D - 957676, 1.4s > > 10+8 - 3649238, 5.8s > D+8 - 16110745, 74.5s > > Thanks, > Alex. > > > > On Mon, 19 Apr 2010 14:01:14 -0600, Stefan Frey <ste...@we...> > wrote: > >> Hi Alex, >> I have attached a document that contains the detailed numbers for >> several >> train combinations without and with the revenue prediction active. >> >> The following figures are defined: >> revenue evaluation: how often the revenue of all trains is evaluated >> edges travelled: how many edges were followed during the search >> predictions: how often the potential maximum revenue was predicted. >> >> My desktop is even slower as my laptop, as it is slightly older and has >> an AMD >> processor. >> >> It clearly shows that revenue predictions is strongest for train >> combinations >> and non-diesel trains. Running a diesel alone is not any faster, unless >> an >> optimal solution is found (early). >> >> Stefan >> >> I sent that to the develop list, as others might also be interested in >> those >> numbers. I extract the main figures below, >> all runs on the test scenario A. >> >> 8 train alone: >> without prediction: 3.8k evaluations, 16.4k edges, time: < 1 sec >> with prediction: 62 evaluations, 858 predictions, 2.3k edges, < 1 sec >> >> 8 and 10 trains: >> without prediction: 1.9M evaluations, 11.0M edges, time: 90 sec >> with prediction: 25k evaluations, 143k predictions, 387k edges, time: 4 >> sec >> >> This clearly shows the strong increase of possible solutions, if more >> than one >> train is involved. It is around 1:500! >> >> Diesel train: >> without prediction: 424k evaluations, 3.3M edges, time: 25 sec >> with prediction: 335k evaluations, 753k predictions, 2.6M edges, time: >> 23 sec >> (In this example an optimal solution is found, but late). >> >> A diesel is less complicated than the combination of an 8 and 10, but >> the >> revenue prediction does no help. >> >> Diesel and a 6 train: >> without prediction: 7.3M evaluations, 52.5M edges, time: 480 sec >> with prediction: 231k evaluations, 2.8M predictions, 6.2M edges, time: >> 56 sec >> >> Adding a 6 train, increases the running time by 20 without prediction, >> but >> only a little more than doubles with prediction. >> >> >> >> On Sunday 18 April 2010 17:44:04 you wrote: >>> Hi Stefan, >>> >>> I would agree about the name of the first number. >>> >>> (1) should be ok, I do the same, and there is no good reason for the >>> algorithm to try evaluating route that just extend already evaluated >>> route >>> by some stations the train can't reach anyway. Or we could run the test >>> on >>> "express" train that can skip anything. Express trains (or any train >>> capable of skipping cities) actually make me wonder what are possible >>> rules about visiting the same hex. In some games train is not allowed >>> to >>> visit the same hex twice (when there are 2 separate cities on the >>> tile). >>> If there is any game with this rule and with express trains, then >>> there's >>> a question - if the train skips one city in the hex and counts another >>> - >>> is it valid route? >>> >>> (2) I apply the same method to the routes, but I didn't evaluate "half" >>> routes - I only evaluate complete route (consisting of those 2 parts). >>> How >>> can you do differently? - There might be bonus for visiting 2 cities in >>> different halves, or something like east-west run. >>> >>> If it's difficult to extract this number from your code now, we could >>> set >>> up example with the station in the dead-end, so there's only one way to >>> leave it. >>> >>> Number of segments is relevant to the two-phased approach only. It is >>> number of edges in the "coarse" graph (which is the same as number of >>> distinct ways to travel between any pair of cities). You were asking >>> about >>> this number earlier to evaluate amount of memory that would need to be >>> stored. >>> >>> I've also done profiling and it appears that storing segment exclusions >>> as >>> a vector of segments excluded by each segment is fine - this is not a >>> bottleneck. So I haven't tried 2D array of booleans approach. But maybe >>> I >>> should try some different cases (for example set of 4 trains (2,2,3 and >>> 3) >>> - that may have a bottleneck in different places comparing to the case >>> of >>> few long trains). >>> >>> Thanks, >>> Alex. >>> >>> On Sun, 18 Apr 2010 13:28:24 -0600, Stefan Frey <ste...@we...> >>> wrote: >>> > Hi Alex, >>> > I would call the first statistic "number of route evaluations" and >>> it >>> > counts >>> > every call to the evaluation function. This figure is also available >>> for >>> > multiple-train runs. If we have the same number, it is almost sure >>> that >>> > the >>> > two algorithms work identical. If not, it proves nothing, see below. >>> > >>> > Potential problems: >>> > 1) I terminate trains as soon as possible, thus numbers depend on the >>> > sequence >>> > of vertexes visited. >>> > >>> > 2) I have train runs divided in two half trains: First the head train >>> > starts >>> > and each station the train can return to its start token and then the >>> > bottom >>> > train runs. To avoid duplication of routes (due to symmetry) the >>> bottom >>> > train >>> > can only start to the side with increased orientation. If I remember >>> > that is >>> > a different approach to yours. >>> > >>> > So if we want to compare figures we have to run a train with infinite >>> > length >>> > (to avoid termination) and is not allowed to run twice from the start >>> > vertex. >>> > >>> > I will have to adjust my codes to accommodate for such a test. >>> > >>> > The other statistic I am not fully clear about: Wat is exactly the >>> > number of >>> > segments? If this is related to the two-phase approach I assume this >>> is >>> > the >>> > maximum number of connections between two stations on the map? >>> > And I guess, that this might be the answer to the unrelated question >>> I >>> > raised >>> > before. This strengthens the case of your approach. I will implement >>> it >>> > as >>> > soon as I have some time left, which will be most likely after the >>> next >>> > release. >>> > >>> > Stefan >>> > >>> > On Sunday 18 April 2010 06:34:51 you wrote: >>> >> Hi Stefan, >>> >> >>> >> I thought it might be useful to compare how many routes we try >>> during >>> >> the >>> >> complete route search. We should be getting the same number. If we >>> are >>> >> not >>> >> it will indicate that one of us (or both) have a bug. I suppose to >>> test >>> >> it >>> >> we would need to run a single sufficiently long train (or maybe try >>> for >>> >> various train lengths) on the same track. >>> >> >>> >> I've also checked on number of segments in two-phased approach. In >>> the >>> >> scenario B there are just 153 segments. >>> >> >>> >> Thanks, >>> >> Alex. >> > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |
From: John A. T. <ja...@ja...> - 2010-04-20 05:08:14
|
On Tue, Apr 20, 2010 at 12:49 AM, alexti <al...@sh...> wrote: > Btw, in what order do you iterate over trains? I go from longest to > shortest. On some earlier tests I've decided that it worked better, but > now I wonder if the diesel case might be an exception... > Do you backtrack after choosing a route for the larger train? If not, then it seems you aren't going to get optimal routes, since in many cases the optimal run for a group of trains is not optimal for any one of them. As a simple example consider two 3 trains running on A-B-C, where the only token is in B. Clearly the best run is A-B and B-C, which is not optimal for either 3 train. This particular example, or a variation of it, comes up *very* often in early games. -- John A. Tamplin |
From: alexti <al...@sh...> - 2010-04-20 05:32:09
|
On Mon, 19 Apr 2010 23:07:46 -0600, John A. Tamplin <ja...@ja...> wrote: > On Tue, Apr 20, 2010 at 12:49 AM, alexti <al...@sh...> wrote: > >> Btw, in what order do you iterate over trains? I go from longest to >> shortest. On some earlier tests I've decided that it worked better, but >> now I wonder if the diesel case might be an exception... >> > > Do you backtrack after choosing a route for the larger train? If not, > then > it seems you aren't going to get optimal routes, since in many cases the > optimal run for a group of trains is not optimal for any one of them. > As a > simple example consider two 3 trains running on A-B-C, where the only > token > is in B. Clearly the best run is A-B and B-C, which is not optimal for > either 3 train. This particular example, or a variation of it, comes up > *very* often in early games. Considering that both trains are identical, how the order in which they are iterated over would matter? Assuming we're talking about brute force algorithm I believe that you're thinking about something else (not the effects of the train iteration order). But let me elaborate on my reasoning. Let's consider the case of 3 and 2 trains. If we start the iteration from 3 train, the first attempt will be made to apply it to the route B-C (in my algorithm, but any brute force algorithm will eventually get to this B-C route). After eliminating this route from the graph, the remaining graph A-B will contain only one route which will be assigned to 2-train. Exactly the same will happen in the case of shortest-to-longest iteration order. So, no matter, what is the train iteration order, every route combination will get evaluated. However, the performance may vary depending on whether the inner loop runs over larger or smaller graph. If there are several route sets with identical values, it may also lead to different route set being selected. However, your comment brings an interesting point: let's say we still have the same example, but now we have 3 trains: one 3 and two 2s. Longest-to-shortest order will result in 3 and 2 being used and shortest-to-longest in 2 and 2 being used. And in both cases alternative option (2+2 instead of 3+2 and vica versa) won't even be attempted. The reason for that is that I don't consider 'null' route a route. To have complete scan I would need to simply eliminate a train and find the optimal solution with the remaining trains. I wonder if this matters in any existing 18xx. But, after reading recent design discussion about train obsolescence, I realize that this may actually matter if an obsolete train has reduced revenue. That means that in the example above running 3+2 on the exactly same route set might be better than 2+2. |
From: Stefan F. <ste...@we...> - 2010-04-20 06:03:43
|
Hi John, I believe that Alex already is considering another questions than you raise: Yes we both optimize all trains simultaneously. To give a precise answer my possible tree extensions at each station vertex are the following: 1) Traverse each edge to the neighbor vertex 2) If head train: start bottom train from start token 3) Start next (head) train 4) If vertex with value then evaluate train set Each head train starts at the virtual HQ to each of the available (start) tokens. This explains the huge increase in evaluations if two trains are run, instead of one. 8 train alone: without prediction: 3.8k evaluations, 16.4k edges, time: < 1 sec with prediction: 62 evaluations, 858 predictions, 2.3k edges, < 1 sec 8 and 10 trains: without prediction: 1.9M evaluations, 11.0M edges, time: 90 sec with prediction: 25k evaluations, 143k predictions, 387k edges, time: 4 sec I can generate an example, where trains are run sub-length, if you are still in doubt. Stefan > > I am just saying if you choose the best route for one train first, and then > find the best route for remaining trains, you won't find the optimal run > for all the trains. > |
From: alexti <al...@sh...> - 2010-04-21 02:56:28
|
I think that I have identical procedure, but when you say you evaluate train set at (4), and let's say you have 2 trains, does it increase evaluation count by 1 or by 2? I count it as 2 evaluations. In practice I keep results of evaluation of the first train while trying possible routes for the second train. On Tue, 20 Apr 2010 00:03:35 -0600, Stefan Frey <ste...@we...> wrote: > Hi John, > I believe that Alex already is considering another questions than you > raise: > > Yes we both optimize all trains simultaneously. To give a precise answer > my > possible tree extensions at each station vertex are the following: > > 1) Traverse each edge to the neighbor vertex > 2) If head train: start bottom train from start token > 3) Start next (head) train > 4) If vertex with value then evaluate train set > > Each head train starts at the virtual HQ to each of the available (start) > tokens. > > This explains the huge increase in evaluations if two trains are run, > instead > of one. > > 8 train alone: > without prediction: 3.8k evaluations, 16.4k edges, time: < 1 sec > with prediction: 62 evaluations, 858 predictions, 2.3k edges, < 1 sec > > 8 and 10 trains: > without prediction: 1.9M evaluations, 11.0M edges, time: 90 sec > with prediction: 25k evaluations, 143k predictions, 387k edges, time: 4 > sec > > I can generate an example, where trains are run sub-length, if you are > still > in doubt. > > Stefan > > >> >> I am just saying if you choose the best route for one train first, and >> then >> find the best route for remaining trains, you won't find the optimal run >> for all the trains. >> > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |
From: Stefan F. (web.de) <ste...@we...> - 2010-04-20 22:14:25
Attachments:
revenue_example_trainset.jpg
|
And using the new route display allows to give the simple example on a 1889 map, that hopefully answers the question below. The TR has 4, 3, 3 trains, but each of them is cut down to run as a 2 train. The same happens for the IR later that round. Stefan On Tuesday 20 April 2010 07:50:51 John A. Tamplin wrote: > I am just saying if you choose the best route for one train first, and then > find the best route for remaining trains, you won't find the optimal run > for all the trains. |
From: Chris S. <chr...@gm...> - 2010-04-21 00:08:05
|
The image shows three trains running but only two colors of highlighting. Why are both trains running F9-G10 and G10-G12 the same color? Shouldn't there be three colors? -- Chris Please consider the environment before printing this e-mail. On Tue, Apr 20, 2010 at 3:14 PM, Stefan Frey (web.de) <ste...@we...> wrote: > And using the new route display allows to give the simple example on a 1889 > map, that hopefully answers the question below. > The TR has 4, 3, 3 trains, but each of them is cut down to run as a 2 train. > The same happens for the IR later that round. > > Stefan > > On Tuesday 20 April 2010 07:50:51 John A. Tamplin wrote: >> I am just saying if you choose the best route for one train first, and then >> find the best route for remaining trains, you won't find the optimal run >> for all the trains. > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: Steve U. <ste...@gm...> - 2010-04-21 00:35:42
|
I see three different colors. BTW, in my trying out the CVS version I saw the route calculation running "excess" trains with a route including just one city. Steve Undy st...@ro... On Tue, Apr 20, 2010 at 6:07 PM, Chris Shaffer <chr...@gm...>wrote: > The image shows three trains running but only two colors of > highlighting. Why are both trains running F9-G10 and G10-G12 the same > color? Shouldn't there be three colors? > > -- > Chris > > Please consider the environment before printing this e-mail. > > > > On Tue, Apr 20, 2010 at 3:14 PM, Stefan Frey (web.de) > <ste...@we...> wrote: > > And using the new route display allows to give the simple example on a > 1889 > > map, that hopefully answers the question below. > > The TR has 4, 3, 3 trains, but each of them is cut down to run as a 2 > train. > > The same happens for the IR later that round. > > > > Stefan > > > > On Tuesday 20 April 2010 07:50:51 John A. Tamplin wrote: > >> I am just saying if you choose the best route for one train first, and > then > >> find the best route for remaining trains, you won't find the optimal run > >> for all the trains. > > > > > > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Chris S. <chr...@gm...> - 2010-04-21 02:02:50
|
Really? OK, I looked closer in better lighting and I see that it is pale pink and pale peach. If you go live with this, you gotta choose contrasting colors. Great work, by the way. -- Chris Please consider the environment before printing this e-mail. On Tue, Apr 20, 2010 at 5:35 PM, Steve Undy <ste...@gm...> wrote: > I see three different colors. > > BTW, in my trying out the CVS version I saw the route calculation running > "excess" trains with a route including just one city. > > Steve Undy > st...@ro... > > > On Tue, Apr 20, 2010 at 6:07 PM, Chris Shaffer <chr...@gm...> > wrote: >> >> The image shows three trains running but only two colors of >> highlighting. Why are both trains running F9-G10 and G10-G12 the same >> color? Shouldn't there be three colors? >> >> -- >> Chris >> >> Please consider the environment before printing this e-mail. >> >> >> >> On Tue, Apr 20, 2010 at 3:14 PM, Stefan Frey (web.de) >> <ste...@we...> wrote: >> > And using the new route display allows to give the simple example on a >> > 1889 >> > map, that hopefully answers the question below. >> > The TR has 4, 3, 3 trains, but each of them is cut down to run as a 2 >> > train. >> > The same happens for the IR later that round. >> > >> > Stefan >> > >> > On Tuesday 20 April 2010 07:50:51 John A. Tamplin wrote: >> >> I am just saying if you choose the best route for one train first, and >> >> then >> >> find the best route for remaining trains, you won't find the optimal >> >> run >> >> for all the trains. >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> > >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: John A. T. <ja...@ja...> - 2010-04-20 05:51:18
|
On Tue, Apr 20, 2010 at 1:32 AM, alexti <al...@sh...> wrote: > Considering that both trains are identical, how the order in which they > are iterated over would matter? Assuming we're talking about brute force > algorithm I believe that you're thinking about something else (not the > effects of the train iteration order). But let me elaborate on my > reasoning. > I am just saying if you choose the best route for one train first, and then find the best route for remaining trains, you won't find the optimal run for all the trains. > However, your comment brings an interesting point: let's say we still have > the same example, but now we have 3 trains: one 3 and two 2s. > Longest-to-shortest order will result in 3 and 2 being used and > shortest-to-longest in 2 and 2 being used. And in both cases alternative > option (2+2 instead of 3+2 and vica versa) won't even be attempted. The > reason for that is that I don't consider 'null' route a route. To have > complete scan I would need to simply eliminate a train and find the > optimal solution with the remaining trains. I wonder if this matters in > any existing 18xx. But, after reading recent design discussion about train > obsolescence, I realize that this may actually matter if an obsolete train > has reduced revenue. That means that in the example above running 3+2 on > the exactly same route set might be better than 2+2. Similar issues apply in games where only certain types of trains get certain bonuses (and in fact you might have the two trains left get different bonuses for different stops). -- John A. Tamplin |
From: alexti <al...@sh...> - 2010-04-21 02:32:35
|
On Mon, 19 Apr 2010 23:50:51 -0600, John A. Tamplin <ja...@ja...> wrote: > On Tue, Apr 20, 2010 at 1:32 AM, alexti <al...@sh...> wrote: > >> Considering that both trains are identical, how the order in which they >> are iterated over would matter? Assuming we're talking about brute force >> algorithm I believe that you're thinking about something else (not the >> effects of the train iteration order). But let me elaborate on my >> reasoning. >> > > I am just saying if you choose the best route for one train first, and > then > find the best route for remaining trains, you won't find the optimal run > for > all the trains. That's correct. That's why we have to iterate over the trains - I wish we didn't have to, but I don't see any way to avoid it. >> However, your comment brings an interesting point: let's say we still >> have >> the same example, but now we have 3 trains: one 3 and two 2s. >> Longest-to-shortest order will result in 3 and 2 being used and >> shortest-to-longest in 2 and 2 being used. And in both cases alternative >> option (2+2 instead of 3+2 and vica versa) won't even be attempted. The >> reason for that is that I don't consider 'null' route a route. To have >> complete scan I would need to simply eliminate a train and find the >> optimal solution with the remaining trains. I wonder if this matters in >> any existing 18xx. But, after reading recent design discussion about >> train >> obsolescence, I realize that this may actually matter if an obsolete >> train >> has reduced revenue. That means that in the example above running 3+2 on >> the exactly same route set might be better than 2+2. > > > Similar issues apply in games where only certain types of trains get > certain > bonuses (and in fact you might have the two trains left get different > bonuses for different stops). Yeah, I even can construct a case with 4D and 5 train in 18AL where it's better to run 4D only instead of running both trains. I need to add "null" route into consideration. Stefan, would you implementation be affected by the same issue? |
From: Stefan F. (web.de) <ste...@we...> - 2010-04-20 22:11:08
Attachments:
revenue_scenario_A_diesel.jpg
|
Another milestone for revenue calculation: The found runs are shown on the Rail map. Colors and strokes are currently defined in the HexMap class. Undo and scaling is not yet supported. As an example I have attached the Diesel run on Scenario A. Stefan |
From: Phil D. <de...@gm...> - 2010-04-20 22:24:09
|
I'd just like to voice my opinion about how awesome this is and that I wish I had the time and intelligence to contribute meaningfully! I'll do my part by thoroughly playtesting the resultant product! Phil On 20 April 2010 23:10, Stefan Frey (web.de) <ste...@we...> wrote: > Another milestone for revenue calculation: > The found runs are shown on the Rail map. > > Colors and strokes are currently defined in the HexMap class. > Undo and scaling is not yet supported. > > As an example I have attached the Diesel run on Scenario A. > Stefan > > ------------------------------------------------------------------------------ > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: Erik V. <eri...@xs...> - 2010-04-21 18:51:08
|
Stefan, I can only say that I'm very impressed with what you have achieved on route awareness and revenue calculation. I have tried a few cases and the results all seem correct to me. Great work! Erik. -----Original Message----- From: Stefan Frey (web.de) [mailto:ste...@we...] Sent: Wednesday 21 April 2010 00:11 To: Development list for Rails: an 18xx game Subject: Re: [Rails-devel] Route calculation validations Another milestone for revenue calculation: The found runs are shown on the Rail map. Colors and strokes are currently defined in the HexMap class. Undo and scaling is not yet supported. As an example I have attached the Diesel run on Scenario A. Stefan |
From: Stefan F. (web.de) <ste...@we...> - 2010-04-22 20:15:42
|
Erik & Phil: thanks for the compliments. I want to pass a substantial part of that to Alex, without his example and ideas I would have even started trying. This reminds that still most work is ahead us, as nearly each 18xx has some subtle tricks in the revenue part too. Stefan On Wednesday 21 April 2010 20:51:05 Erik Vos wrote: > Stefan, > > I can only say that I'm very impressed with what you have achieved on route > awareness and revenue calculation. > I have tried a few cases and the results all seem correct to me. Great > work! > > Erik. > > > I'd just like to voice my opinion about how awesome this is and that I > wish I had the time and intelligence to contribute meaningfully! > > I'll do my part by thoroughly playtesting the resultant product! > > Phil |
From: Chris S. <chr...@gm...> - 2010-04-22 20:21:04
|
I will echo the compliments - this is a really great development. Even those who would prefer that Rails not suggest revenue amounts should benefit from the utility of this code, which will allow many other features (restricting track and token placement for one) to be developed. -- Chris Please consider the environment before printing this e-mail. On Thu, Apr 22, 2010 at 1:15 PM, Stefan Frey (web.de) <ste...@we...> wrote: > Erik & Phil: > thanks for the compliments. > I want to pass a substantial part of that to Alex, without his example and > ideas I would have even started trying. > This reminds that still most work is ahead us, as nearly each 18xx > has some subtle tricks in the revenue part too. > Stefan > > > On Wednesday 21 April 2010 20:51:05 Erik Vos wrote: >> Stefan, >> >> I can only say that I'm very impressed with what you have achieved on route >> awareness and revenue calculation. >> I have tried a few cases and the results all seem correct to me. Great >> work! >> >> Erik. >> >> > >> I'd just like to voice my opinion about how awesome this is and that I >> wish I had the time and intelligence to contribute meaningfully! >> >> I'll do my part by thoroughly playtesting the resultant product! >> >> Phil > > ------------------------------------------------------------------------------ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |