You can subscribe to this list here.
2005 |
Jan
|
Feb
(25) |
Mar
(84) |
Apr
(76) |
May
(25) |
Jun
(1) |
Jul
(28) |
Aug
(23) |
Sep
(50) |
Oct
(46) |
Nov
(65) |
Dec
(76) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(60) |
Feb
(33) |
Mar
(4) |
Apr
(17) |
May
(16) |
Jun
(18) |
Jul
(131) |
Aug
(11) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(5) |
2007 |
Jan
(71) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(19) |
Jul
(40) |
Aug
(38) |
Sep
(7) |
Oct
(58) |
Nov
|
Dec
(10) |
2008 |
Jan
(17) |
Feb
(27) |
Mar
(12) |
Apr
(1) |
May
(50) |
Jun
(10) |
Jul
|
Aug
(15) |
Sep
(24) |
Oct
(64) |
Nov
(115) |
Dec
(47) |
2009 |
Jan
(30) |
Feb
(1) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(4) |
Nov
(132) |
Dec
(93) |
2010 |
Jan
(266) |
Feb
(120) |
Mar
(168) |
Apr
(127) |
May
(83) |
Jun
(93) |
Jul
(77) |
Aug
(77) |
Sep
(86) |
Oct
(30) |
Nov
(4) |
Dec
(22) |
2011 |
Jan
(48) |
Feb
(81) |
Mar
(198) |
Apr
(174) |
May
(72) |
Jun
(101) |
Jul
(236) |
Aug
(144) |
Sep
(54) |
Oct
(132) |
Nov
(94) |
Dec
(111) |
2012 |
Jan
(135) |
Feb
(166) |
Mar
(86) |
Apr
(85) |
May
(137) |
Jun
(83) |
Jul
(54) |
Aug
(29) |
Sep
(49) |
Oct
(37) |
Nov
(8) |
Dec
(6) |
2013 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
(14) |
May
(5) |
Jun
(15) |
Jul
|
Aug
(38) |
Sep
(44) |
Oct
(45) |
Nov
(40) |
Dec
(23) |
2014 |
Jan
(22) |
Feb
(63) |
Mar
(43) |
Apr
(60) |
May
(10) |
Jun
(5) |
Jul
(13) |
Aug
(57) |
Sep
(36) |
Oct
(2) |
Nov
(30) |
Dec
(27) |
2015 |
Jan
(5) |
Feb
(2) |
Mar
(14) |
Apr
(3) |
May
|
Jun
(3) |
Jul
(10) |
Aug
(63) |
Sep
(31) |
Oct
(26) |
Nov
(11) |
Dec
(6) |
2016 |
Jan
|
Feb
(11) |
Mar
|
Apr
|
May
(1) |
Jun
(16) |
Jul
|
Aug
(4) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(1) |
2017 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(20) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(10) |
May
(10) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
(9) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
(4) |
2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael A. <out...@gm...> - 2013-09-01 16:40:05
|
I have not currently released the specific version I'm working on to anyone. I was planning on just making a .jar file and sending it to the group I'm in who are playing, and someone from the other group asked for it as well. Both groups seem interested in the current progress, and it's well known that it's still at an alpha/beta stage. On Sun, Sep 1, 2013 at 12:15 PM, Stefan Frey <ste...@we...> wrote: > So I have to get myself updated on your progress with 1880. > Been some time I had a look at it. > > How do you release your changes to the users currently, as I have not > done any new releases for some time now? > > Documentation of the new features was mainly done by a set of mails > to this list. As soon as time permits I will put them together > on the wiki, if it still exists after the sourceforge updates. > > > > On 09/01/2013 04:29 PM, Michael Alexander wrote: > > I'm hesitant to port it immediately, as it's very close (I think) to be > > being completely playable under 1.7. We have a couple groups that are > > actively playing it right now, they just haven't gotten to the stage > > where it doesn't quite work. Maybe in the very short term we can get it > > to the stage where they can finish their games, then we could work on > > porting it to 2.0. I'm more than willing to help port it to 2.0. > > > > Is there anything that documents the changes with 2.0? > > > > Mike > > > > > > On Sun, Sep 1, 2013 at 10:05 AM, Stefan Frey <ste...@we... > > <mailto:ste...@we...>> wrote: > > > > Rails 2.0 has been ready to roll out for an alpha release since > > February. I delayed that as I have not found a reasonable time slot > > to react on feedback from testers. > > > > All changes of the Rails1.x branch that happened after the creation > of > > the Rails2.0 branch were already merged with Rails2.0. > > > > The only exception are all work done with respect to 1880. > > My main issue there is that I have never played 1880, thus I know > 1880 > > only from the rules. And if I remember correctly there are a few > things > > which are not easy to implement as they touch areas of the Rails > which > > might require some re-work. > > > > That was the long answer. The short-answer is: > > > > * Test releases from Rails2.0 branch are possible already. > > > > * I recommend moving 1880 development to Rails2.0 as 1880 > > would benefit from upcoming rewrite of the code. > > > > * If you take care of merging the 1880 changes into Rails2.0, this > would > > help me a lot. However feel free to ask for help anytime. > > > > Stefan > > > > > > On 08/29/2013 02:18 PM, Michael Alexander wrote: > > > How close is 2.0 to being ready to roll out? Should we be > > considering > > > moving the 1880_specific branch to be under 2.0? > > > > > > > > > On Thu, Aug 29, 2013 at 6:56 AM, Stefan Frey <ste...@we... > > <mailto:ste...@we...> > > > <mailto:ste...@we... <mailto:ste...@we...>>> wrote: > > > > > > You coded against Rail 1.x, this part of the code is upgraded > in > > > Rails 2.0 branches. > > > Especially the connectivity functions are improved. If you > > check out > > > Rails 2.0 you will realize that it supports full verification > of > > > tile lays. > > > So I suggest that you code that functionally in 2.0 otherwise > it > > > will most likely duplicate efforts and will not be mergeable. > > > > > > > > > Michael Alexander <out...@gm... > > <mailto:out...@gm...> > > > <mailto:out...@gm... > > <mailto:out...@gm...>>> wrote: > > > > > > So what I found was that the NetworkIterator stopped at > nodes > > > that were sinks. If I want to be able to build a graph > that > > > just tells me that I'm connected and ignores tokens in > > the way, > > > I think I need to add a setting to NetworkIterator to > > tell it if > > > it should ignore sinks. As this is a complicated area of > the > > > code, and it's not limited to the 1880 specific areas, I'd > > > appreciate some feedback on my proposed changes: > > > > > > diff --git a/rails/algorithms/NetworkCompanyGraph.java > > > b/rails/algorithms/NetworkCompanyGraph.java > > > index bd93113..0e5b2c8 100644 > > > --- a/rails/algorithms/NetworkCompanyGraph.java > > > +++ b/rails/algorithms/NetworkCompanyGraph.java > > > @@ -64,7 +64,8 @@ > > > return phase2Graph; > > > } > > > > > > - public SimpleGraph<NetworkVertex, NetworkEdge> > > > createRouteGraph(boolean addHQ) { > > > + > > > + private SimpleGraph<NetworkVertex, NetworkEdge> > > > createGraph(boolean addHQ, boolean ignoreSinks) { > > > // get mapgraph from builder > > > SimpleGraph<NetworkVertex, NetworkEdge> > mapGraph = > > > graphBuilder.getMapGraph(); > > > > > > @@ -88,7 +89,7 @@ > > > // add connection to graph > > > graph.addVertex(vertex); > > > graph.addEdge(vertex, hqVertex, new > > > NetworkEdge(vertex, hqVertex, false)); > > > - NetworkIterator iterator = new > > > NetworkIterator(mapGraph, vertex, company); > > > + NetworkIterator iterator = new > > > NetworkIterator(mapGraph, vertex, company, ignoreSinks); > > > for (;iterator.hasNext();) > > > vertexes.add(iterator.next()); > > > // restore sink property > > > @@ -112,6 +113,14 @@ > > > return graph; > > > } > > > > > > + public SimpleGraph<NetworkVertex, NetworkEdge> > > > createRouteGraph(boolean addHQ) { > > > + return createGraph(addHQ, false); > > > + } > > > + > > > + public SimpleGraph<NetworkVertex, NetworkEdge> > > > createConnectionGraph(boolean addHQ) { > > > + return createGraph(addHQ, true); > > > + } > > > + > > > public List<NetworkVertex> > > > getCompanyBaseTokenVertexes(PublicCompanyI company) { > > > List<NetworkVertex> vertexes = new > > > ArrayList<NetworkVertex>(); > > > for (TokenI token:company.getTokens()){ > > > diff --git a/rails/algorithms/NetworkIterator.java > > > b/rails/algorithms/NetworkIterator.java > > > index f4029e8..1adc0a6 100644 > > > --- a/rails/algorithms/NetworkIterator.java > > > +++ b/rails/algorithms/NetworkIterator.java > > > @@ -26,6 +26,7 @@ > > > private NetworkVertex startVertex; > > > private boolean startVertexVisited; > > > private boolean routeIterator; > > > + private boolean ignoreSinks; > > > > > > // internal data > > > private List<NetworkVertex> stack = new > > > ArrayList<NetworkVertex>(); > > > @@ -41,14 +42,14 @@ > > > > > > public NetworkIterator(Graph<NetworkVertex, > > NetworkEdge> > > > graph, > > > NetworkVertex startVertex) { > > > - this(graph, startVertex, null); > > > + this(graph, startVertex, null, false); > > > } > > > > > > /** > > > * Returns NetworkIterator for specific company > > > */ > > > public NetworkIterator(Graph<NetworkVertex, > > NetworkEdge> > > > graph, NetworkVertex startVertex, > > > - PublicCompanyI company) { > > > + PublicCompanyI company, boolean ignoreSinks) > { > > > super(); > > > > > > if (graph == null) > > > @@ -61,6 +62,7 @@ > > > this.startVertex = startVertex; > > > this.startVertexVisited = false; > > > this.routeIterator = false; > > > + this.ignoreSinks = ignoreSinks; > > > } > > > > > > NetworkIterator setRouteIterator(boolean > > routeIterator) { > > > @@ -174,7 +176,7 @@ > > > > > > private void addUnseenChildrenOf(NetworkVertex > vertex, > > > boolean greedy) { > > > > > > - if (vertex.isSink()) return; > > > + if (vertex.isSink() && (!ignoreSinks)) return; > > > log.debug("Iterator: Add unseen children of " + > > vertex); > > > > > > for (NetworkEdge edge : graph.edgesOf(vertex)) { > > > diff --git a/rails/algorithms/NetworkVertex.java > > > b/rails/algorithms/NetworkVertex.java > > > index 91356af..03045b9 100644 > > > --- a/rails/algorithms/NetworkVertex.java > > > +++ b/rails/algorithms/NetworkVertex.java > > > @@ -311,7 +311,7 @@ > > > */ > > > public static void > > > initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> > graph, > > > PublicCompanyI company, PhaseI phase) { > > > - > > > + > > > // store vertices for removal > > > List<NetworkVertex> verticesToRemove = new > > > ArrayList<NetworkVertex>(); > > > for (NetworkVertex v:graph.vertexSet()) { > > > > > > > > > On Wed, Aug 28, 2013 at 4:52 PM, Michael > > > Alexander<out...@gm... > > <mailto:out...@gm...> > > > <mailto:out...@gm... > > <mailto:out...@gm...>>> wrote: > > > > > > Here's what I ended up with so far: > > > > > > compA is the private investor > > > compB is the company to check to see if there is > a > > > connection with > > > > > > PublicCompanyI compA = > operatingCompany.get(); > > > ... > > > NetworkGraphBuilder nwGraph = > > > NetworkGraphBuilder.create(gameManager); > > > NetworkCompanyGraph companyGraph = > > > NetworkCompanyGraph.create(nwGraph, compA); > > > SimpleGraph<NetworkVertex, NetworkEdge> > > graph = > > > companyGraph.createRouteGraph(true); > > > Set<NetworkVertex> verticies = > > graph.vertexSet(); > > > ... > > > for (TokenI token : compB.getTokens()) { > > > TokenHolder holder = > token.getHolder(); > > > if (!(holder instanceof Stop)) > continue; > > > Stop city = (Stop) holder; > > > Station station = > > city.getRelatedStation(); > > > > > > for (NetworkVertex vert : verticies) > { > > > if (vert.getType() == > > > NetworkVertex.VertexType.STATION) { > > > Station vertStation = > > > vert.getStation(); > > > if (station == vertStation) { > > > // There is a link > > between the > > > companies! Hooray! > > > } > > > } > > > } > > > } > > > ... > > > > > > This seems to work for simple cases, however, I > suspect > > > (without digging too much) that it will get blocked by > > > tokens, which I can't have. I bet it won't be too > > hard to > > > fix, tho. > > > > > > Mike > > > > > > > > > > > > On Wed, Aug 28, 2013 at 2:38 PM, brett > > > lentz<bre...@gm... > > <mailto:bre...@gm...> <mailto:bre...@gm... > > <mailto:bre...@gm...>>> > > > wrote: > > > > > > In order to do tile rotations, there is already > logic > > > that is aware of the "exits" of a tile. There's > > also the > > > route suggestion code. > > > > > > It might be possible to leverage that same code to > > > create a route graph that enables detection of > > > destination runs. > > > > > > It probably needs a fair bit of work to adapt for > > this > > > purpose, but those are at least places in the > code to > > > start looking. > > > > > > ---Brett. > > > > > > > > > ---Brett. > > > > > > > > > On Wed, Aug 28, 2013 at 9:50 AM, Chris > > > Shaffer<chr...@gm... > > <mailto:chr...@gm...> > > > <mailto:chr...@gm... > > <mailto:chr...@gm...>>> wrote: > > > > > > There are games where tokens do block > > destinations, > > > so whatever code > > > you write should allow for that possibility. > > There > > > are also games > > > where connections are considered complete as > > soon as > > > the tile is laid, > > > and others where the check occurs during the > > > relevant company's > > > operating turn. > > > > > > -- > > > Chris > > > > > > Please consider the environment before > > printing this > > > e-mail. > > > > > > > > > On Wed, Aug 28, 2013 at 6:35 AM, Michael > > Alexander > > > <out...@gm... > > <mailto:out...@gm...> > > > <mailto:out...@gm... > > <mailto:out...@gm...>>> wrote: > > > > Both Major Companies in 1856 and Foreign > > > Investors in 1880 have the idea of > > > > needing to reach a destination. Both are > > > implemented by having the game > > > > player use a special action to tell the > game > > > engine that a connection has > > > > taken place. Once the connection exists, > some > > > one time event occurs. It > > > > seems like if there is code that could be > > used to > > > determine if a connection > > > > exists, the game could automatically > determine > > > that without relying on the > > > > player to tell it. > > > > > > > > So I actually want something slightly > > different > > > than what I said. It's not > > > > that the current company can make a run > > between > > > two hexes that I want to > > > > know, it's that a connection exists > > (regardless > > > of tokens). > > > > > > > > Mike > > > > > > > > > > > > On Wed, Aug 28, 2013 at 9:28 AM, Chris > Shaffer > > > <chr...@gm... > > <mailto:chr...@gm...> > > > <mailto:chr...@gm... > > <mailto:chr...@gm...>>> > > > > wrote: > > > >> > > > >> Would this be for games where companies > are > > > limited to building track > > > >> where their trains can actually reach, or > > some > > > other purpose? > > > >> > > > >> -- > > > >> Chris > > > >> > > > >> Please consider the environment before > > printing > > > this e-mail. > > > >> > > > >> > > > >> On Tue, Aug 27, 2013 at 11:24 PM, Michael > > Alexander > > > >> <out...@gm... > > <mailto:out...@gm...> > > > <mailto:out...@gm... > > <mailto:out...@gm...>>> wrote: > > > >> > Everyone, > > > >> > > > > >> > I'd like to add a check to see if > the > > > currently operating company > > > >> > can > > > >> > run from specific MapHex to another. > > It seems > > > like there should be a > > > >> > way to > > > >> > do this, since a similar calculation > would > > > have to be made when > > > >> > determining > > > >> > what MapHexs are eligible to have a tile > > > placed, but I can't seem to > > > >> > figure > > > >> > out how to do it. What am I missing? > > > >> > > > > >> > Thanks, > > > >> > > > > >> > Michael Alexander > > > >> > > > > >> > > > > >> > > > > > > > ------------------------------------------------------------------------------ > > > >> > Learn the latest--Visual Studio 2012, > > > SharePoint 2013, SQL 2012, more! > > > >> > Discover the easy way to master current > and > > > previous Microsoft > > > >> > technologies > > > >> > and advance your career. Get an > incredible > > > 1,500+ hours of step-by-step > > > >> > tutorial videos with LearnDevNow. > Subscribe > > > today and save! > > > >> > > > > >> > > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk< > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > >> > > > _______________________________________________ > > > >> > Rails-devel mailing list > > > >> >Rai...@li... > > <mailto:Rai...@li...> > > > <mailto:Rai...@li... > > <mailto:Rai...@li...>> > > > >> > > > > > >https://lists.sourceforge.net/lists/listinfo/rails-devel > > <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > >> > > > > >> > > > >> > > > >> > > > > > > ------------------------------------------------------------------------------ > > > >> Learn the latest--Visual Studio 2012, > > SharePoint > > > 2013, SQL 2012, more! > > > >> Discover the easy way to master current > and > > > previous Microsoft > > > >> technologies > > > >> and advance your career. Get an incredible > > > 1,500+ hours of step-by-step > > > >> tutorial videos with LearnDevNow. > Subscribe > > > today and save! > > > >> > > > > > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk< > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > >> > > _______________________________________________ > > > >> Rails-devel mailing list > > > >>Rai...@li... > > <mailto:Rai...@li...> > > > <mailto:Rai...@li... > > <mailto:Rai...@li...>> > > > > > >>https://lists.sourceforge.net/lists/listinfo/rails-devel > > <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > Learn the latest--Visual Studio 2012, > > SharePoint > > > 2013, SQL 2012, more! > > > > Discover the easy way to master current and > > > previous Microsoft technologies > > > > and advance your career. Get an incredible > > 1,500+ > > > hours of step-by-step > > > > tutorial videos with LearnDevNow. > > Subscribe today > > > and save! > > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk< > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > > > > _______________________________________________ > > > > Rails-devel mailing list > > > >Rai...@li... > > <mailto:Rai...@li...> > > > <mailto:Rai...@li... > > <mailto:Rai...@li...>> > > > > > >https://lists.sourceforge.net/lists/listinfo/rails-devel > > <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Learn the latest--Visual Studio 2012, > SharePoint > > > 2013, SQL 2012, more! > > > Discover the easy way to master current and > > previous > > > Microsoft technologies > > > and advance your career. Get an incredible > 1,500+ > > > hours of step-by-step > > > tutorial videos with LearnDevNow. Subscribe > today > > > and save! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > _______________________________________________ > > > Rails-devel mailing list > > > Rai...@li... > > <mailto:Rai...@li...> > > > <mailto:Rai...@li... > > <mailto:Rai...@li...>> > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Learn the latest--Visual Studio 2012, SharePoint > > 2013, > > > SQL 2012, more! > > > Discover the easy way to master current and > previous > > > Microsoft technologies > > > and advance your career. Get an incredible 1,500+ > > hours > > > of step-by-step > > > tutorial videos with LearnDevNow. Subscribe today > > and save! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > _______________________________________________ > > > Rails-devel mailing list > > > Rai...@li... > > <mailto:Rai...@li...> > > > <mailto:Rai...@li... > > <mailto:Rai...@li...>> > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL > > 2012, more! > > > Discover the easy way to master current and previous Microsoft > > > technologies > > > and advance your career. Get an incredible 1,500+ hours of > > step-by-step > > > tutorial videos with LearnDevNow. Subscribe today and save! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > _______________________________________________ > > > Rails-devel mailing list > > > Rai...@li... > > <mailto:Rai...@li...> > > > <mailto:Rai...@li... > > <mailto:Rai...@li...>> > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, > > more! > > > Discover the easy way to master current and previous Microsoft > > technologies > > > and advance your career. Get an incredible 1,500+ hours of > > step-by-step > > > tutorial videos with LearnDevNow. Subscribe today and save! > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > > > > > > > > _______________________________________________ > > > Rails-devel mailing list > > > Rai...@li... > > <mailto:Rai...@li...> > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, > more! > > Discover the easy way to master current and previous Microsoft > > technologies > > and advance your career. Get an incredible 1,500+ hours of > step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > <mailto:Rai...@li...> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > > Discover the easy way to master current and previous Microsoft > technologies > > and advance your career. Get an incredible 1,500+ hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > > > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Stefan F. <ste...@we...> - 2013-09-01 16:16:08
|
So I have to get myself updated on your progress with 1880. Been some time I had a look at it. How do you release your changes to the users currently, as I have not done any new releases for some time now? Documentation of the new features was mainly done by a set of mails to this list. As soon as time permits I will put them together on the wiki, if it still exists after the sourceforge updates. On 09/01/2013 04:29 PM, Michael Alexander wrote: > I'm hesitant to port it immediately, as it's very close (I think) to be > being completely playable under 1.7. We have a couple groups that are > actively playing it right now, they just haven't gotten to the stage > where it doesn't quite work. Maybe in the very short term we can get it > to the stage where they can finish their games, then we could work on > porting it to 2.0. I'm more than willing to help port it to 2.0. > > Is there anything that documents the changes with 2.0? > > Mike > > > On Sun, Sep 1, 2013 at 10:05 AM, Stefan Frey <ste...@we... > <mailto:ste...@we...>> wrote: > > Rails 2.0 has been ready to roll out for an alpha release since > February. I delayed that as I have not found a reasonable time slot > to react on feedback from testers. > > All changes of the Rails1.x branch that happened after the creation of > the Rails2.0 branch were already merged with Rails2.0. > > The only exception are all work done with respect to 1880. > My main issue there is that I have never played 1880, thus I know 1880 > only from the rules. And if I remember correctly there are a few things > which are not easy to implement as they touch areas of the Rails which > might require some re-work. > > That was the long answer. The short-answer is: > > * Test releases from Rails2.0 branch are possible already. > > * I recommend moving 1880 development to Rails2.0 as 1880 > would benefit from upcoming rewrite of the code. > > * If you take care of merging the 1880 changes into Rails2.0, this would > help me a lot. However feel free to ask for help anytime. > > Stefan > > > On 08/29/2013 02:18 PM, Michael Alexander wrote: > > How close is 2.0 to being ready to roll out? Should we be > considering > > moving the 1880_specific branch to be under 2.0? > > > > > > On Thu, Aug 29, 2013 at 6:56 AM, Stefan Frey <ste...@we... > <mailto:ste...@we...> > > <mailto:ste...@we... <mailto:ste...@we...>>> wrote: > > > > You coded against Rail 1.x, this part of the code is upgraded in > > Rails 2.0 branches. > > Especially the connectivity functions are improved. If you > check out > > Rails 2.0 you will realize that it supports full verification of > > tile lays. > > So I suggest that you code that functionally in 2.0 otherwise it > > will most likely duplicate efforts and will not be mergeable. > > > > > > Michael Alexander <out...@gm... > <mailto:out...@gm...> > > <mailto:out...@gm... > <mailto:out...@gm...>>> wrote: > > > > So what I found was that the NetworkIterator stopped at nodes > > that were sinks. If I want to be able to build a graph that > > just tells me that I'm connected and ignores tokens in > the way, > > I think I need to add a setting to NetworkIterator to > tell it if > > it should ignore sinks. As this is a complicated area of the > > code, and it's not limited to the 1880 specific areas, I'd > > appreciate some feedback on my proposed changes: > > > > diff --git a/rails/algorithms/NetworkCompanyGraph.java > > b/rails/algorithms/NetworkCompanyGraph.java > > index bd93113..0e5b2c8 100644 > > --- a/rails/algorithms/NetworkCompanyGraph.java > > +++ b/rails/algorithms/NetworkCompanyGraph.java > > @@ -64,7 +64,8 @@ > > return phase2Graph; > > } > > > > - public SimpleGraph<NetworkVertex, NetworkEdge> > > createRouteGraph(boolean addHQ) { > > + > > + private SimpleGraph<NetworkVertex, NetworkEdge> > > createGraph(boolean addHQ, boolean ignoreSinks) { > > // get mapgraph from builder > > SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = > > graphBuilder.getMapGraph(); > > > > @@ -88,7 +89,7 @@ > > // add connection to graph > > graph.addVertex(vertex); > > graph.addEdge(vertex, hqVertex, new > > NetworkEdge(vertex, hqVertex, false)); > > - NetworkIterator iterator = new > > NetworkIterator(mapGraph, vertex, company); > > + NetworkIterator iterator = new > > NetworkIterator(mapGraph, vertex, company, ignoreSinks); > > for (;iterator.hasNext();) > > vertexes.add(iterator.next()); > > // restore sink property > > @@ -112,6 +113,14 @@ > > return graph; > > } > > > > + public SimpleGraph<NetworkVertex, NetworkEdge> > > createRouteGraph(boolean addHQ) { > > + return createGraph(addHQ, false); > > + } > > + > > + public SimpleGraph<NetworkVertex, NetworkEdge> > > createConnectionGraph(boolean addHQ) { > > + return createGraph(addHQ, true); > > + } > > + > > public List<NetworkVertex> > > getCompanyBaseTokenVertexes(PublicCompanyI company) { > > List<NetworkVertex> vertexes = new > > ArrayList<NetworkVertex>(); > > for (TokenI token:company.getTokens()){ > > diff --git a/rails/algorithms/NetworkIterator.java > > b/rails/algorithms/NetworkIterator.java > > index f4029e8..1adc0a6 100644 > > --- a/rails/algorithms/NetworkIterator.java > > +++ b/rails/algorithms/NetworkIterator.java > > @@ -26,6 +26,7 @@ > > private NetworkVertex startVertex; > > private boolean startVertexVisited; > > private boolean routeIterator; > > + private boolean ignoreSinks; > > > > // internal data > > private List<NetworkVertex> stack = new > > ArrayList<NetworkVertex>(); > > @@ -41,14 +42,14 @@ > > > > public NetworkIterator(Graph<NetworkVertex, > NetworkEdge> > > graph, > > NetworkVertex startVertex) { > > - this(graph, startVertex, null); > > + this(graph, startVertex, null, false); > > } > > > > /** > > * Returns NetworkIterator for specific company > > */ > > public NetworkIterator(Graph<NetworkVertex, > NetworkEdge> > > graph, NetworkVertex startVertex, > > - PublicCompanyI company) { > > + PublicCompanyI company, boolean ignoreSinks) { > > super(); > > > > if (graph == null) > > @@ -61,6 +62,7 @@ > > this.startVertex = startVertex; > > this.startVertexVisited = false; > > this.routeIterator = false; > > + this.ignoreSinks = ignoreSinks; > > } > > > > NetworkIterator setRouteIterator(boolean > routeIterator) { > > @@ -174,7 +176,7 @@ > > > > private void addUnseenChildrenOf(NetworkVertex vertex, > > boolean greedy) { > > > > - if (vertex.isSink()) return; > > + if (vertex.isSink() && (!ignoreSinks)) return; > > log.debug("Iterator: Add unseen children of " + > vertex); > > > > for (NetworkEdge edge : graph.edgesOf(vertex)) { > > diff --git a/rails/algorithms/NetworkVertex.java > > b/rails/algorithms/NetworkVertex.java > > index 91356af..03045b9 100644 > > --- a/rails/algorithms/NetworkVertex.java > > +++ b/rails/algorithms/NetworkVertex.java > > @@ -311,7 +311,7 @@ > > */ > > public static void > > initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph, > > PublicCompanyI company, PhaseI phase) { > > - > > + > > // store vertices for removal > > List<NetworkVertex> verticesToRemove = new > > ArrayList<NetworkVertex>(); > > for (NetworkVertex v:graph.vertexSet()) { > > > > > > On Wed, Aug 28, 2013 at 4:52 PM, Michael > > Alexander<out...@gm... > <mailto:out...@gm...> > > <mailto:out...@gm... > <mailto:out...@gm...>>> wrote: > > > > Here's what I ended up with so far: > > > > compA is the private investor > > compB is the company to check to see if there is a > > connection with > > > > PublicCompanyI compA = operatingCompany.get(); > > ... > > NetworkGraphBuilder nwGraph = > > NetworkGraphBuilder.create(gameManager); > > NetworkCompanyGraph companyGraph = > > NetworkCompanyGraph.create(nwGraph, compA); > > SimpleGraph<NetworkVertex, NetworkEdge> > graph = > > companyGraph.createRouteGraph(true); > > Set<NetworkVertex> verticies = > graph.vertexSet(); > > ... > > for (TokenI token : compB.getTokens()) { > > TokenHolder holder = token.getHolder(); > > if (!(holder instanceof Stop)) continue; > > Stop city = (Stop) holder; > > Station station = > city.getRelatedStation(); > > > > for (NetworkVertex vert : verticies) { > > if (vert.getType() == > > NetworkVertex.VertexType.STATION) { > > Station vertStation = > > vert.getStation(); > > if (station == vertStation) { > > // There is a link > between the > > companies! Hooray! > > } > > } > > } > > } > > ... > > > > This seems to work for simple cases, however, I suspect > > (without digging too much) that it will get blocked by > > tokens, which I can't have. I bet it won't be too > hard to > > fix, tho. > > > > Mike > > > > > > > > On Wed, Aug 28, 2013 at 2:38 PM, brett > > lentz<bre...@gm... > <mailto:bre...@gm...> <mailto:bre...@gm... > <mailto:bre...@gm...>>> > > wrote: > > > > In order to do tile rotations, there is already logic > > that is aware of the "exits" of a tile. There's > also the > > route suggestion code. > > > > It might be possible to leverage that same code to > > create a route graph that enables detection of > > destination runs. > > > > It probably needs a fair bit of work to adapt for > this > > purpose, but those are at least places in the code to > > start looking. > > > > ---Brett. > > > > > > ---Brett. > > > > > > On Wed, Aug 28, 2013 at 9:50 AM, Chris > > Shaffer<chr...@gm... > <mailto:chr...@gm...> > > <mailto:chr...@gm... > <mailto:chr...@gm...>>> wrote: > > > > There are games where tokens do block > destinations, > > so whatever code > > you write should allow for that possibility. > There > > are also games > > where connections are considered complete as > soon as > > the tile is laid, > > and others where the check occurs during the > > relevant company's > > operating turn. > > > > -- > > Chris > > > > Please consider the environment before > printing this > > e-mail. > > > > > > On Wed, Aug 28, 2013 at 6:35 AM, Michael > Alexander > > <out...@gm... > <mailto:out...@gm...> > > <mailto:out...@gm... > <mailto:out...@gm...>>> wrote: > > > Both Major Companies in 1856 and Foreign > > Investors in 1880 have the idea of > > > needing to reach a destination. Both are > > implemented by having the game > > > player use a special action to tell the game > > engine that a connection has > > > taken place. Once the connection exists, some > > one time event occurs. It > > > seems like if there is code that could be > used to > > determine if a connection > > > exists, the game could automatically determine > > that without relying on the > > > player to tell it. > > > > > > So I actually want something slightly > different > > than what I said. It's not > > > that the current company can make a run > between > > two hexes that I want to > > > know, it's that a connection exists > (regardless > > of tokens). > > > > > > Mike > > > > > > > > > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer > > <chr...@gm... > <mailto:chr...@gm...> > > <mailto:chr...@gm... > <mailto:chr...@gm...>>> > > > wrote: > > >> > > >> Would this be for games where companies are > > limited to building track > > >> where their trains can actually reach, or > some > > other purpose? > > >> > > >> -- > > >> Chris > > >> > > >> Please consider the environment before > printing > > this e-mail. > > >> > > >> > > >> On Tue, Aug 27, 2013 at 11:24 PM, Michael > Alexander > > >> <out...@gm... > <mailto:out...@gm...> > > <mailto:out...@gm... > <mailto:out...@gm...>>> wrote: > > >> > Everyone, > > >> > > > >> > I'd like to add a check to see if the > > currently operating company > > >> > can > > >> > run from specific MapHex to another. > It seems > > like there should be a > > >> > way to > > >> > do this, since a similar calculation would > > have to be made when > > >> > determining > > >> > what MapHexs are eligible to have a tile > > placed, but I can't seem to > > >> > figure > > >> > out how to do it. What am I missing? > > >> > > > >> > Thanks, > > >> > > > >> > Michael Alexander > > >> > > > >> > > > >> > > > > ------------------------------------------------------------------------------ > > >> > Learn the latest--Visual Studio 2012, > > SharePoint 2013, SQL 2012, more! > > >> > Discover the easy way to master current and > > previous Microsoft > > >> > technologies > > >> > and advance your career. Get an incredible > > 1,500+ hours of step-by-step > > >> > tutorial videos with LearnDevNow. Subscribe > > today and save! > > >> > > > >> > > > >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> > > >> > > _______________________________________________ > > >> > Rails-devel mailing list > > >> >Rai...@li... > <mailto:Rai...@li...> > > <mailto:Rai...@li... > <mailto:Rai...@li...>> > > >> > > > >https://lists.sourceforge.net/lists/listinfo/rails-devel > <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > >> > > > >> > > >> > > >> > > > ------------------------------------------------------------------------------ > > >> Learn the latest--Visual Studio 2012, > SharePoint > > 2013, SQL 2012, more! > > >> Discover the easy way to master current and > > previous Microsoft > > >> technologies > > >> and advance your career. Get an incredible > > 1,500+ hours of step-by-step > > >> tutorial videos with LearnDevNow. Subscribe > > today and save! > > >> > > > >>http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> > > >> > _______________________________________________ > > >> Rails-devel mailing list > > >>Rai...@li... > <mailto:Rai...@li...> > > <mailto:Rai...@li... > <mailto:Rai...@li...>> > > > >>https://lists.sourceforge.net/lists/listinfo/rails-devel > <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Learn the latest--Visual Studio 2012, > SharePoint > > 2013, SQL 2012, more! > > > Discover the easy way to master current and > > previous Microsoft technologies > > > and advance your career. Get an incredible > 1,500+ > > hours of step-by-step > > > tutorial videos with LearnDevNow. > Subscribe today > > and save! > > > >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> > > > > _______________________________________________ > > > Rails-devel mailing list > > >Rai...@li... > <mailto:Rai...@li...> > > <mailto:Rai...@li... > <mailto:Rai...@li...>> > > > >https://lists.sourceforge.net/lists/listinfo/rails-devel > <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint > > 2013, SQL 2012, more! > > Discover the easy way to master current and > previous > > Microsoft technologies > > and advance your career. Get an incredible 1,500+ > > hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today > > and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > <mailto:Rai...@li...> > > <mailto:Rai...@li... > <mailto:Rai...@li...>> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint > 2013, > > SQL 2012, more! > > Discover the easy way to master current and previous > > Microsoft technologies > > and advance your career. Get an incredible 1,500+ > hours > > of step-by-step > > tutorial videos with LearnDevNow. Subscribe today > and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > <mailto:Rai...@li...> > > <mailto:Rai...@li... > <mailto:Rai...@li...>> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL > 2012, more! > > Discover the easy way to master current and previous Microsoft > > technologies > > and advance your career. Get an incredible 1,500+ hours of > step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > <mailto:Rai...@li...> > > <mailto:Rai...@li... > <mailto:Rai...@li...>> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, > more! > > Discover the easy way to master current and previous Microsoft > technologies > > and advance your career. Get an incredible 1,500+ hours of > step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > > > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > <mailto:Rai...@li...> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft > technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > <mailto:Rai...@li...> > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Chris S. <chr...@gm...> - 2013-09-01 14:38:44
|
If you port it, we'll happily replay our game up to the point it's at now and port it as well. -- Chris Please consider the environment before printing this e-mail. On Sun, Sep 1, 2013 at 7:29 AM, Michael Alexander <out...@gm...> wrote: > I'm hesitant to port it immediately, as it's very close (I think) to be > being completely playable under 1.7. We have a couple groups that are > actively playing it right now, they just haven't gotten to the stage where > it doesn't quite work. Maybe in the very short term we can get it to the > stage where they can finish their games, then we could work on porting it to > 2.0. I'm more than willing to help port it to 2.0. > > Is there anything that documents the changes with 2.0? > > Mike > > > On Sun, Sep 1, 2013 at 10:05 AM, Stefan Frey <ste...@we...> wrote: >> >> Rails 2.0 has been ready to roll out for an alpha release since >> February. I delayed that as I have not found a reasonable time slot >> to react on feedback from testers. >> >> All changes of the Rails1.x branch that happened after the creation of >> the Rails2.0 branch were already merged with Rails2.0. >> >> The only exception are all work done with respect to 1880. >> My main issue there is that I have never played 1880, thus I know 1880 >> only from the rules. And if I remember correctly there are a few things >> which are not easy to implement as they touch areas of the Rails which >> might require some re-work. >> >> That was the long answer. The short-answer is: >> >> * Test releases from Rails2.0 branch are possible already. >> >> * I recommend moving 1880 development to Rails2.0 as 1880 >> would benefit from upcoming rewrite of the code. >> >> * If you take care of merging the 1880 changes into Rails2.0, this would >> help me a lot. However feel free to ask for help anytime. >> >> Stefan >> >> >> On 08/29/2013 02:18 PM, Michael Alexander wrote: >> > How close is 2.0 to being ready to roll out? Should we be considering >> > moving the 1880_specific branch to be under 2.0? >> > >> > >> > On Thu, Aug 29, 2013 at 6:56 AM, Stefan Frey <ste...@we... >> > <mailto:ste...@we...>> wrote: >> > >> > You coded against Rail 1.x, this part of the code is upgraded in >> > Rails 2.0 branches. >> > Especially the connectivity functions are improved. If you check out >> > Rails 2.0 you will realize that it supports full verification of >> > tile lays. >> > So I suggest that you code that functionally in 2.0 otherwise it >> > will most likely duplicate efforts and will not be mergeable. >> > >> > >> > Michael Alexander <out...@gm... >> > <mailto:out...@gm...>> wrote: >> > >> > So what I found was that the NetworkIterator stopped at nodes >> > that were sinks. If I want to be able to build a graph that >> > just tells me that I'm connected and ignores tokens in the way, >> > I think I need to add a setting to NetworkIterator to tell it if >> > it should ignore sinks. As this is a complicated area of the >> > code, and it's not limited to the 1880 specific areas, I'd >> > appreciate some feedback on my proposed changes: >> > >> > diff --git a/rails/algorithms/NetworkCompanyGraph.java >> > b/rails/algorithms/NetworkCompanyGraph.java >> > index bd93113..0e5b2c8 100644 >> > --- a/rails/algorithms/NetworkCompanyGraph.java >> > +++ b/rails/algorithms/NetworkCompanyGraph.java >> > @@ -64,7 +64,8 @@ >> > return phase2Graph; >> > } >> > >> > - public SimpleGraph<NetworkVertex, NetworkEdge> >> > createRouteGraph(boolean addHQ) { >> > + >> > + private SimpleGraph<NetworkVertex, NetworkEdge> >> > createGraph(boolean addHQ, boolean ignoreSinks) { >> > // get mapgraph from builder >> > SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = >> > graphBuilder.getMapGraph(); >> > >> > @@ -88,7 +89,7 @@ >> > // add connection to graph >> > graph.addVertex(vertex); >> > graph.addEdge(vertex, hqVertex, new >> > NetworkEdge(vertex, hqVertex, false)); >> > - NetworkIterator iterator = new >> > NetworkIterator(mapGraph, vertex, company); >> > + NetworkIterator iterator = new >> > NetworkIterator(mapGraph, vertex, company, ignoreSinks); >> > for (;iterator.hasNext();) >> > vertexes.add(iterator.next()); >> > // restore sink property >> > @@ -112,6 +113,14 @@ >> > return graph; >> > } >> > >> > + public SimpleGraph<NetworkVertex, NetworkEdge> >> > createRouteGraph(boolean addHQ) { >> > + return createGraph(addHQ, false); >> > + } >> > + >> > + public SimpleGraph<NetworkVertex, NetworkEdge> >> > createConnectionGraph(boolean addHQ) { >> > + return createGraph(addHQ, true); >> > + } >> > + >> > public List<NetworkVertex> >> > getCompanyBaseTokenVertexes(PublicCompanyI company) { >> > List<NetworkVertex> vertexes = new >> > ArrayList<NetworkVertex>(); >> > for (TokenI token:company.getTokens()){ >> > diff --git a/rails/algorithms/NetworkIterator.java >> > b/rails/algorithms/NetworkIterator.java >> > index f4029e8..1adc0a6 100644 >> > --- a/rails/algorithms/NetworkIterator.java >> > +++ b/rails/algorithms/NetworkIterator.java >> > @@ -26,6 +26,7 @@ >> > private NetworkVertex startVertex; >> > private boolean startVertexVisited; >> > private boolean routeIterator; >> > + private boolean ignoreSinks; >> > >> > // internal data >> > private List<NetworkVertex> stack = new >> > ArrayList<NetworkVertex>(); >> > @@ -41,14 +42,14 @@ >> > >> > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> >> > graph, >> > NetworkVertex startVertex) { >> > - this(graph, startVertex, null); >> > + this(graph, startVertex, null, false); >> > } >> > >> > /** >> > * Returns NetworkIterator for specific company >> > */ >> > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> >> > graph, NetworkVertex startVertex, >> > - PublicCompanyI company) { >> > + PublicCompanyI company, boolean ignoreSinks) { >> > super(); >> > >> > if (graph == null) >> > @@ -61,6 +62,7 @@ >> > this.startVertex = startVertex; >> > this.startVertexVisited = false; >> > this.routeIterator = false; >> > + this.ignoreSinks = ignoreSinks; >> > } >> > >> > NetworkIterator setRouteIterator(boolean routeIterator) { >> > @@ -174,7 +176,7 @@ >> > >> > private void addUnseenChildrenOf(NetworkVertex vertex, >> > boolean greedy) { >> > >> > - if (vertex.isSink()) return; >> > + if (vertex.isSink() && (!ignoreSinks)) return; >> > log.debug("Iterator: Add unseen children of " + >> > vertex); >> > >> > for (NetworkEdge edge : graph.edgesOf(vertex)) { >> > diff --git a/rails/algorithms/NetworkVertex.java >> > b/rails/algorithms/NetworkVertex.java >> > index 91356af..03045b9 100644 >> > --- a/rails/algorithms/NetworkVertex.java >> > +++ b/rails/algorithms/NetworkVertex.java >> > @@ -311,7 +311,7 @@ >> > */ >> > public static void >> > initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph, >> > PublicCompanyI company, PhaseI phase) { >> > - >> > + >> > // store vertices for removal >> > List<NetworkVertex> verticesToRemove = new >> > ArrayList<NetworkVertex>(); >> > for (NetworkVertex v:graph.vertexSet()) { >> > >> > >> > On Wed, Aug 28, 2013 at 4:52 PM, Michael >> > Alexander<out...@gm... >> > <mailto:out...@gm...>> wrote: >> > >> > Here's what I ended up with so far: >> > >> > compA is the private investor >> > compB is the company to check to see if there is a >> > connection with >> > >> > PublicCompanyI compA = operatingCompany.get(); >> > ... >> > NetworkGraphBuilder nwGraph = >> > NetworkGraphBuilder.create(gameManager); >> > NetworkCompanyGraph companyGraph = >> > NetworkCompanyGraph.create(nwGraph, compA); >> > SimpleGraph<NetworkVertex, NetworkEdge> graph = >> > companyGraph.createRouteGraph(true); >> > Set<NetworkVertex> verticies = >> > graph.vertexSet(); >> > ... >> > for (TokenI token : compB.getTokens()) { >> > TokenHolder holder = token.getHolder(); >> > if (!(holder instanceof Stop)) continue; >> > Stop city = (Stop) holder; >> > Station station = city.getRelatedStation(); >> > >> > for (NetworkVertex vert : verticies) { >> > if (vert.getType() == >> > NetworkVertex.VertexType.STATION) { >> > Station vertStation = >> > vert.getStation(); >> > if (station == vertStation) { >> > // There is a link between the >> > companies! Hooray! >> > } >> > } >> > } >> > } >> > ... >> > >> > This seems to work for simple cases, however, I suspect >> > (without digging too much) that it will get blocked by >> > tokens, which I can't have. I bet it won't be too hard to >> > fix, tho. >> > >> > Mike >> > >> > >> > >> > On Wed, Aug 28, 2013 at 2:38 PM, brett >> > lentz<bre...@gm... <mailto:bre...@gm...>> >> > wrote: >> > >> > In order to do tile rotations, there is already logic >> > that is aware of the "exits" of a tile. There's also the >> > route suggestion code. >> > >> > It might be possible to leverage that same code to >> > create a route graph that enables detection of >> > destination runs. >> > >> > It probably needs a fair bit of work to adapt for this >> > purpose, but those are at least places in the code to >> > start looking. >> > >> > ---Brett. >> > >> > >> > ---Brett. >> > >> > >> > On Wed, Aug 28, 2013 at 9:50 AM, Chris >> > Shaffer<chr...@gm... >> > <mailto:chr...@gm...>> wrote: >> > >> > There are games where tokens do block destinations, >> > so whatever code >> > you write should allow for that possibility. There >> > are also games >> > where connections are considered complete as soon as >> > the tile is laid, >> > and others where the check occurs during the >> > relevant company's >> > operating turn. >> > >> > -- >> > Chris >> > >> > Please consider the environment before printing this >> > e-mail. >> > >> > >> > On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander >> > <out...@gm... >> > <mailto:out...@gm...>> wrote: >> > > Both Major Companies in 1856 and Foreign >> > Investors in 1880 have the idea of >> > > needing to reach a destination. Both are >> > implemented by having the game >> > > player use a special action to tell the game >> > engine that a connection has >> > > taken place. Once the connection exists, some >> > one time event occurs. It >> > > seems like if there is code that could be used to >> > determine if a connection >> > > exists, the game could automatically determine >> > that without relying on the >> > > player to tell it. >> > > >> > > So I actually want something slightly different >> > than what I said. It's not >> > > that the current company can make a run between >> > two hexes that I want to >> > > know, it's that a connection exists (regardless >> > of tokens). >> > > >> > > Mike >> > > >> > > >> > > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer >> > <chr...@gm... >> > <mailto:chr...@gm...>> >> > > wrote: >> > >> >> > >> Would this be for games where companies are >> > limited to building track >> > >> where their trains can actually reach, or some >> > other purpose? >> > >> >> > >> -- >> > >> Chris >> > >> >> > >> Please consider the environment before printing >> > this e-mail. >> > >> >> > >> >> > >> On Tue, Aug 27, 2013 at 11:24 PM, Michael >> > Alexander >> > >> <out...@gm... >> > <mailto:out...@gm...>> wrote: >> > >> > Everyone, >> > >> > >> > >> > I'd like to add a check to see if the >> > currently operating company >> > >> > can >> > >> > run from specific MapHex to another. It seems >> > like there should be a >> > >> > way to >> > >> > do this, since a similar calculation would >> > have to be made when >> > >> > determining >> > >> > what MapHexs are eligible to have a tile >> > placed, but I can't seem to >> > >> > figure >> > >> > out how to do it. What am I missing? >> > >> > >> > >> > Thanks, >> > >> > >> > >> > Michael Alexander >> > >> > >> > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > >> > Learn the latest--Visual Studio 2012, >> > SharePoint 2013, SQL 2012, more! >> > >> > Discover the easy way to master current and >> > previous Microsoft >> > >> > technologies >> > >> > and advance your career. Get an incredible >> > 1,500+ hours of step-by-step >> > >> > tutorial videos with LearnDevNow. Subscribe >> > today and save! >> > >> > >> > >> >> > >> > >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> >> > >> > >> > _______________________________________________ >> > >> > Rails-devel mailing list >> > >> >Rai...@li... >> > <mailto:Rai...@li...> >> > >> >> > >> > >https://lists.sourceforge.net/lists/listinfo/rails-devel >> > <https://lists.sourceforge.net/lists/listinfo/rails-devel> >> > >> > >> > >> >> > >> >> > >> >> > >> > ------------------------------------------------------------------------------ >> > >> Learn the latest--Visual Studio 2012, SharePoint >> > 2013, SQL 2012, more! >> > >> Discover the easy way to master current and >> > previous Microsoft >> > >> technologies >> > >> and advance your career. Get an incredible >> > 1,500+ hours of step-by-step >> > >> tutorial videos with LearnDevNow. Subscribe >> > today and save! >> > >> >> > >> > >>http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> >> > >> _______________________________________________ >> > >> Rails-devel mailing list >> > >>Rai...@li... >> > <mailto:Rai...@li...> >> > >> > >>https://lists.sourceforge.net/lists/listinfo/rails-devel >> > <https://lists.sourceforge.net/lists/listinfo/rails-devel> >> > > >> > > >> > > >> > > >> > >> > ------------------------------------------------------------------------------ >> > > Learn the latest--Visual Studio 2012, SharePoint >> > 2013, SQL 2012, more! >> > > Discover the easy way to master current and >> > previous Microsoft technologies >> > > and advance your career. Get an incredible 1,500+ >> > hours of step-by-step >> > > tutorial videos with LearnDevNow. Subscribe today >> > and save! >> > >> > >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> >> > > _______________________________________________ >> > > Rails-devel mailing list >> > >Rai...@li... >> > <mailto:Rai...@li...> >> > >> > >https://lists.sourceforge.net/lists/listinfo/rails-devel >> > <https://lists.sourceforge.net/lists/listinfo/rails-devel> >> > > >> > >> > >> > ------------------------------------------------------------------------------ >> > Learn the latest--Visual Studio 2012, SharePoint >> > 2013, SQL 2012, more! >> > Discover the easy way to master current and previous >> > Microsoft technologies >> > and advance your career. Get an incredible 1,500+ >> > hours of step-by-step >> > tutorial videos with LearnDevNow. Subscribe today >> > and save! >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > <mailto:Rai...@li...> >> > >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Learn the latest--Visual Studio 2012, SharePoint 2013, >> > SQL 2012, more! >> > Discover the easy way to master current and previous >> > Microsoft technologies >> > and advance your career. Get an incredible 1,500+ hours >> > of step-by-step >> > tutorial videos with LearnDevNow. Subscribe today and >> > save! >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > <mailto:Rai...@li...> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >> > more! >> > Discover the easy way to master current and previous Microsoft >> > technologies >> > and advance your career. Get an incredible 1,500+ hours of >> > step-by-step >> > tutorial videos with LearnDevNow. Subscribe today and save! >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > <mailto:Rai...@li...> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> > Discover the easy way to master current and previous Microsoft >> > technologies >> > and advance your career. Get an incredible 1,500+ hours of step-by-step >> > tutorial videos with LearnDevNow. Subscribe today and save! >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > >> > >> > >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> >> >> >> ------------------------------------------------------------------------------ >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> Discover the easy way to master current and previous Microsoft >> technologies >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> tutorial videos with LearnDevNow. Subscribe today and save! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Michael A. <out...@gm...> - 2013-09-01 14:29:16
|
I'm hesitant to port it immediately, as it's very close (I think) to be being completely playable under 1.7. We have a couple groups that are actively playing it right now, they just haven't gotten to the stage where it doesn't quite work. Maybe in the very short term we can get it to the stage where they can finish their games, then we could work on porting it to 2.0. I'm more than willing to help port it to 2.0. Is there anything that documents the changes with 2.0? Mike On Sun, Sep 1, 2013 at 10:05 AM, Stefan Frey <ste...@we...> wrote: > Rails 2.0 has been ready to roll out for an alpha release since > February. I delayed that as I have not found a reasonable time slot > to react on feedback from testers. > > All changes of the Rails1.x branch that happened after the creation of > the Rails2.0 branch were already merged with Rails2.0. > > The only exception are all work done with respect to 1880. > My main issue there is that I have never played 1880, thus I know 1880 > only from the rules. And if I remember correctly there are a few things > which are not easy to implement as they touch areas of the Rails which > might require some re-work. > > That was the long answer. The short-answer is: > > * Test releases from Rails2.0 branch are possible already. > > * I recommend moving 1880 development to Rails2.0 as 1880 > would benefit from upcoming rewrite of the code. > > * If you take care of merging the 1880 changes into Rails2.0, this would > help me a lot. However feel free to ask for help anytime. > > Stefan > > > On 08/29/2013 02:18 PM, Michael Alexander wrote: > > How close is 2.0 to being ready to roll out? Should we be considering > > moving the 1880_specific branch to be under 2.0? > > > > > > On Thu, Aug 29, 2013 at 6:56 AM, Stefan Frey <ste...@we... > > <mailto:ste...@we...>> wrote: > > > > You coded against Rail 1.x, this part of the code is upgraded in > > Rails 2.0 branches. > > Especially the connectivity functions are improved. If you check out > > Rails 2.0 you will realize that it supports full verification of > > tile lays. > > So I suggest that you code that functionally in 2.0 otherwise it > > will most likely duplicate efforts and will not be mergeable. > > > > > > Michael Alexander <out...@gm... > > <mailto:out...@gm...>> wrote: > > > > So what I found was that the NetworkIterator stopped at nodes > > that were sinks. If I want to be able to build a graph that > > just tells me that I'm connected and ignores tokens in the way, > > I think I need to add a setting to NetworkIterator to tell it if > > it should ignore sinks. As this is a complicated area of the > > code, and it's not limited to the 1880 specific areas, I'd > > appreciate some feedback on my proposed changes: > > > > diff --git a/rails/algorithms/NetworkCompanyGraph.java > > b/rails/algorithms/NetworkCompanyGraph.java > > index bd93113..0e5b2c8 100644 > > --- a/rails/algorithms/NetworkCompanyGraph.java > > +++ b/rails/algorithms/NetworkCompanyGraph.java > > @@ -64,7 +64,8 @@ > > return phase2Graph; > > } > > > > - public SimpleGraph<NetworkVertex, NetworkEdge> > > createRouteGraph(boolean addHQ) { > > + > > + private SimpleGraph<NetworkVertex, NetworkEdge> > > createGraph(boolean addHQ, boolean ignoreSinks) { > > // get mapgraph from builder > > SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = > > graphBuilder.getMapGraph(); > > > > @@ -88,7 +89,7 @@ > > // add connection to graph > > graph.addVertex(vertex); > > graph.addEdge(vertex, hqVertex, new > > NetworkEdge(vertex, hqVertex, false)); > > - NetworkIterator iterator = new > > NetworkIterator(mapGraph, vertex, company); > > + NetworkIterator iterator = new > > NetworkIterator(mapGraph, vertex, company, ignoreSinks); > > for (;iterator.hasNext();) > > vertexes.add(iterator.next()); > > // restore sink property > > @@ -112,6 +113,14 @@ > > return graph; > > } > > > > + public SimpleGraph<NetworkVertex, NetworkEdge> > > createRouteGraph(boolean addHQ) { > > + return createGraph(addHQ, false); > > + } > > + > > + public SimpleGraph<NetworkVertex, NetworkEdge> > > createConnectionGraph(boolean addHQ) { > > + return createGraph(addHQ, true); > > + } > > + > > public List<NetworkVertex> > > getCompanyBaseTokenVertexes(PublicCompanyI company) { > > List<NetworkVertex> vertexes = new > > ArrayList<NetworkVertex>(); > > for (TokenI token:company.getTokens()){ > > diff --git a/rails/algorithms/NetworkIterator.java > > b/rails/algorithms/NetworkIterator.java > > index f4029e8..1adc0a6 100644 > > --- a/rails/algorithms/NetworkIterator.java > > +++ b/rails/algorithms/NetworkIterator.java > > @@ -26,6 +26,7 @@ > > private NetworkVertex startVertex; > > private boolean startVertexVisited; > > private boolean routeIterator; > > + private boolean ignoreSinks; > > > > // internal data > > private List<NetworkVertex> stack = new > > ArrayList<NetworkVertex>(); > > @@ -41,14 +42,14 @@ > > > > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> > > graph, > > NetworkVertex startVertex) { > > - this(graph, startVertex, null); > > + this(graph, startVertex, null, false); > > } > > > > /** > > * Returns NetworkIterator for specific company > > */ > > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> > > graph, NetworkVertex startVertex, > > - PublicCompanyI company) { > > + PublicCompanyI company, boolean ignoreSinks) { > > super(); > > > > if (graph == null) > > @@ -61,6 +62,7 @@ > > this.startVertex = startVertex; > > this.startVertexVisited = false; > > this.routeIterator = false; > > + this.ignoreSinks = ignoreSinks; > > } > > > > NetworkIterator setRouteIterator(boolean routeIterator) { > > @@ -174,7 +176,7 @@ > > > > private void addUnseenChildrenOf(NetworkVertex vertex, > > boolean greedy) { > > > > - if (vertex.isSink()) return; > > + if (vertex.isSink() && (!ignoreSinks)) return; > > log.debug("Iterator: Add unseen children of " + > vertex); > > > > for (NetworkEdge edge : graph.edgesOf(vertex)) { > > diff --git a/rails/algorithms/NetworkVertex.java > > b/rails/algorithms/NetworkVertex.java > > index 91356af..03045b9 100644 > > --- a/rails/algorithms/NetworkVertex.java > > +++ b/rails/algorithms/NetworkVertex.java > > @@ -311,7 +311,7 @@ > > */ > > public static void > > initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph, > > PublicCompanyI company, PhaseI phase) { > > - > > + > > // store vertices for removal > > List<NetworkVertex> verticesToRemove = new > > ArrayList<NetworkVertex>(); > > for (NetworkVertex v:graph.vertexSet()) { > > > > > > On Wed, Aug 28, 2013 at 4:52 PM, Michael > > Alexander<out...@gm... > > <mailto:out...@gm...>> wrote: > > > > Here's what I ended up with so far: > > > > compA is the private investor > > compB is the company to check to see if there is a > > connection with > > > > PublicCompanyI compA = operatingCompany.get(); > > ... > > NetworkGraphBuilder nwGraph = > > NetworkGraphBuilder.create(gameManager); > > NetworkCompanyGraph companyGraph = > > NetworkCompanyGraph.create(nwGraph, compA); > > SimpleGraph<NetworkVertex, NetworkEdge> graph = > > companyGraph.createRouteGraph(true); > > Set<NetworkVertex> verticies = > graph.vertexSet(); > > ... > > for (TokenI token : compB.getTokens()) { > > TokenHolder holder = token.getHolder(); > > if (!(holder instanceof Stop)) continue; > > Stop city = (Stop) holder; > > Station station = city.getRelatedStation(); > > > > for (NetworkVertex vert : verticies) { > > if (vert.getType() == > > NetworkVertex.VertexType.STATION) { > > Station vertStation = > > vert.getStation(); > > if (station == vertStation) { > > // There is a link between the > > companies! Hooray! > > } > > } > > } > > } > > ... > > > > This seems to work for simple cases, however, I suspect > > (without digging too much) that it will get blocked by > > tokens, which I can't have. I bet it won't be too hard to > > fix, tho. > > > > Mike > > > > > > > > On Wed, Aug 28, 2013 at 2:38 PM, brett > > lentz<bre...@gm... <mailto:bre...@gm...>> > > wrote: > > > > In order to do tile rotations, there is already logic > > that is aware of the "exits" of a tile. There's also the > > route suggestion code. > > > > It might be possible to leverage that same code to > > create a route graph that enables detection of > > destination runs. > > > > It probably needs a fair bit of work to adapt for this > > purpose, but those are at least places in the code to > > start looking. > > > > ---Brett. > > > > > > ---Brett. > > > > > > On Wed, Aug 28, 2013 at 9:50 AM, Chris > > Shaffer<chr...@gm... > > <mailto:chr...@gm...>> wrote: > > > > There are games where tokens do block destinations, > > so whatever code > > you write should allow for that possibility. There > > are also games > > where connections are considered complete as soon as > > the tile is laid, > > and others where the check occurs during the > > relevant company's > > operating turn. > > > > -- > > Chris > > > > Please consider the environment before printing this > > e-mail. > > > > > > On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander > > <out...@gm... > > <mailto:out...@gm...>> wrote: > > > Both Major Companies in 1856 and Foreign > > Investors in 1880 have the idea of > > > needing to reach a destination. Both are > > implemented by having the game > > > player use a special action to tell the game > > engine that a connection has > > > taken place. Once the connection exists, some > > one time event occurs. It > > > seems like if there is code that could be used to > > determine if a connection > > > exists, the game could automatically determine > > that without relying on the > > > player to tell it. > > > > > > So I actually want something slightly different > > than what I said. It's not > > > that the current company can make a run between > > two hexes that I want to > > > know, it's that a connection exists (regardless > > of tokens). > > > > > > Mike > > > > > > > > > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer > > <chr...@gm... > > <mailto:chr...@gm...>> > > > wrote: > > >> > > >> Would this be for games where companies are > > limited to building track > > >> where their trains can actually reach, or some > > other purpose? > > >> > > >> -- > > >> Chris > > >> > > >> Please consider the environment before printing > > this e-mail. > > >> > > >> > > >> On Tue, Aug 27, 2013 at 11:24 PM, Michael > Alexander > > >> <out...@gm... > > <mailto:out...@gm...>> wrote: > > >> > Everyone, > > >> > > > >> > I'd like to add a check to see if the > > currently operating company > > >> > can > > >> > run from specific MapHex to another. It seems > > like there should be a > > >> > way to > > >> > do this, since a similar calculation would > > have to be made when > > >> > determining > > >> > what MapHexs are eligible to have a tile > > placed, but I can't seem to > > >> > figure > > >> > out how to do it. What am I missing? > > >> > > > >> > Thanks, > > >> > > > >> > Michael Alexander > > >> > > > >> > > > >> > > > > ------------------------------------------------------------------------------ > > >> > Learn the latest--Visual Studio 2012, > > SharePoint 2013, SQL 2012, more! > > >> > Discover the easy way to master current and > > previous Microsoft > > >> > technologies > > >> > and advance your career. Get an incredible > > 1,500+ hours of step-by-step > > >> > tutorial videos with LearnDevNow. Subscribe > > today and save! > > >> > > > >> > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk< > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > >> > _______________________________________________ > > >> > Rails-devel mailing list > > >> >Rai...@li... > > <mailto:Rai...@li...> > > >> > > > > https://lists.sourceforge.net/lists/listinfo/rails-devel < > https://lists.sourceforge.net/lists/listinfo/rails-devel> > > >> > > > >> > > >> > > >> > > > ------------------------------------------------------------------------------ > > >> Learn the latest--Visual Studio 2012, SharePoint > > 2013, SQL 2012, more! > > >> Discover the easy way to master current and > > previous Microsoft > > >> technologies > > >> and advance your career. Get an incredible > > 1,500+ hours of step-by-step > > >> tutorial videos with LearnDevNow. Subscribe > > today and save! > > >> > > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk< > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > >> _______________________________________________ > > >> Rails-devel mailing list > > >>Rai...@li... > > <mailto:Rai...@li...> > > >> > https://lists.sourceforge.net/lists/listinfo/rails-devel < > https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Learn the latest--Visual Studio 2012, SharePoint > > 2013, SQL 2012, more! > > > Discover the easy way to master current and > > previous Microsoft technologies > > > and advance your career. Get an incredible 1,500+ > > hours of step-by-step > > > tutorial videos with LearnDevNow. Subscribe today > > and save! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk< > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > _______________________________________________ > > > Rails-devel mailing list > > >Rai...@li... > > <mailto:Rai...@li...> > > > > https://lists.sourceforge.net/lists/listinfo/rails-devel < > https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint > > 2013, SQL 2012, more! > > Discover the easy way to master current and previous > > Microsoft technologies > > and advance your career. Get an incredible 1,500+ > > hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today > > and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > <mailto:Rai...@li...> > > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, > > SQL 2012, more! > > Discover the easy way to master current and previous > > Microsoft technologies > > and advance your career. Get an incredible 1,500+ hours > > of step-by-step > > tutorial videos with LearnDevNow. Subscribe today and > save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > <mailto:Rai...@li...> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, > more! > > Discover the easy way to master current and previous Microsoft > > technologies > > and advance your career. Get an incredible 1,500+ hours of > step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > <mailto:Rai...@li...> > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > > Discover the easy way to master current and previous Microsoft > technologies > > and advance your career. Get an incredible 1,500+ hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > > > > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Stefan F. <ste...@we...> - 2013-09-01 14:05:56
|
Rails 2.0 has been ready to roll out for an alpha release since February. I delayed that as I have not found a reasonable time slot to react on feedback from testers. All changes of the Rails1.x branch that happened after the creation of the Rails2.0 branch were already merged with Rails2.0. The only exception are all work done with respect to 1880. My main issue there is that I have never played 1880, thus I know 1880 only from the rules. And if I remember correctly there are a few things which are not easy to implement as they touch areas of the Rails which might require some re-work. That was the long answer. The short-answer is: * Test releases from Rails2.0 branch are possible already. * I recommend moving 1880 development to Rails2.0 as 1880 would benefit from upcoming rewrite of the code. * If you take care of merging the 1880 changes into Rails2.0, this would help me a lot. However feel free to ask for help anytime. Stefan On 08/29/2013 02:18 PM, Michael Alexander wrote: > How close is 2.0 to being ready to roll out? Should we be considering > moving the 1880_specific branch to be under 2.0? > > > On Thu, Aug 29, 2013 at 6:56 AM, Stefan Frey <ste...@we... > <mailto:ste...@we...>> wrote: > > You coded against Rail 1.x, this part of the code is upgraded in > Rails 2.0 branches. > Especially the connectivity functions are improved. If you check out > Rails 2.0 you will realize that it supports full verification of > tile lays. > So I suggest that you code that functionally in 2.0 otherwise it > will most likely duplicate efforts and will not be mergeable. > > > Michael Alexander <out...@gm... > <mailto:out...@gm...>> wrote: > > So what I found was that the NetworkIterator stopped at nodes > that were sinks. If I want to be able to build a graph that > just tells me that I'm connected and ignores tokens in the way, > I think I need to add a setting to NetworkIterator to tell it if > it should ignore sinks. As this is a complicated area of the > code, and it's not limited to the 1880 specific areas, I'd > appreciate some feedback on my proposed changes: > > diff --git a/rails/algorithms/NetworkCompanyGraph.java > b/rails/algorithms/NetworkCompanyGraph.java > index bd93113..0e5b2c8 100644 > --- a/rails/algorithms/NetworkCompanyGraph.java > +++ b/rails/algorithms/NetworkCompanyGraph.java > @@ -64,7 +64,8 @@ > return phase2Graph; > } > > - public SimpleGraph<NetworkVertex, NetworkEdge> > createRouteGraph(boolean addHQ) { > + > + private SimpleGraph<NetworkVertex, NetworkEdge> > createGraph(boolean addHQ, boolean ignoreSinks) { > // get mapgraph from builder > SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = > graphBuilder.getMapGraph(); > > @@ -88,7 +89,7 @@ > // add connection to graph > graph.addVertex(vertex); > graph.addEdge(vertex, hqVertex, new > NetworkEdge(vertex, hqVertex, false)); > - NetworkIterator iterator = new > NetworkIterator(mapGraph, vertex, company); > + NetworkIterator iterator = new > NetworkIterator(mapGraph, vertex, company, ignoreSinks); > for (;iterator.hasNext();) > vertexes.add(iterator.next()); > // restore sink property > @@ -112,6 +113,14 @@ > return graph; > } > > + public SimpleGraph<NetworkVertex, NetworkEdge> > createRouteGraph(boolean addHQ) { > + return createGraph(addHQ, false); > + } > + > + public SimpleGraph<NetworkVertex, NetworkEdge> > createConnectionGraph(boolean addHQ) { > + return createGraph(addHQ, true); > + } > + > public List<NetworkVertex> > getCompanyBaseTokenVertexes(PublicCompanyI company) { > List<NetworkVertex> vertexes = new > ArrayList<NetworkVertex>(); > for (TokenI token:company.getTokens()){ > diff --git a/rails/algorithms/NetworkIterator.java > b/rails/algorithms/NetworkIterator.java > index f4029e8..1adc0a6 100644 > --- a/rails/algorithms/NetworkIterator.java > +++ b/rails/algorithms/NetworkIterator.java > @@ -26,6 +26,7 @@ > private NetworkVertex startVertex; > private boolean startVertexVisited; > private boolean routeIterator; > + private boolean ignoreSinks; > > // internal data > private List<NetworkVertex> stack = new > ArrayList<NetworkVertex>(); > @@ -41,14 +42,14 @@ > > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> > graph, > NetworkVertex startVertex) { > - this(graph, startVertex, null); > + this(graph, startVertex, null, false); > } > > /** > * Returns NetworkIterator for specific company > */ > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> > graph, NetworkVertex startVertex, > - PublicCompanyI company) { > + PublicCompanyI company, boolean ignoreSinks) { > super(); > > if (graph == null) > @@ -61,6 +62,7 @@ > this.startVertex = startVertex; > this.startVertexVisited = false; > this.routeIterator = false; > + this.ignoreSinks = ignoreSinks; > } > > NetworkIterator setRouteIterator(boolean routeIterator) { > @@ -174,7 +176,7 @@ > > private void addUnseenChildrenOf(NetworkVertex vertex, > boolean greedy) { > > - if (vertex.isSink()) return; > + if (vertex.isSink() && (!ignoreSinks)) return; > log.debug("Iterator: Add unseen children of " + vertex); > > for (NetworkEdge edge : graph.edgesOf(vertex)) { > diff --git a/rails/algorithms/NetworkVertex.java > b/rails/algorithms/NetworkVertex.java > index 91356af..03045b9 100644 > --- a/rails/algorithms/NetworkVertex.java > +++ b/rails/algorithms/NetworkVertex.java > @@ -311,7 +311,7 @@ > */ > public static void > initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph, > PublicCompanyI company, PhaseI phase) { > - > + > // store vertices for removal > List<NetworkVertex> verticesToRemove = new > ArrayList<NetworkVertex>(); > for (NetworkVertex v:graph.vertexSet()) { > > > On Wed, Aug 28, 2013 at 4:52 PM, Michael > Alexander<out...@gm... > <mailto:out...@gm...>> wrote: > > Here's what I ended up with so far: > > compA is the private investor > compB is the company to check to see if there is a > connection with > > PublicCompanyI compA = operatingCompany.get(); > ... > NetworkGraphBuilder nwGraph = > NetworkGraphBuilder.create(gameManager); > NetworkCompanyGraph companyGraph = > NetworkCompanyGraph.create(nwGraph, compA); > SimpleGraph<NetworkVertex, NetworkEdge> graph = > companyGraph.createRouteGraph(true); > Set<NetworkVertex> verticies = graph.vertexSet(); > ... > for (TokenI token : compB.getTokens()) { > TokenHolder holder = token.getHolder(); > if (!(holder instanceof Stop)) continue; > Stop city = (Stop) holder; > Station station = city.getRelatedStation(); > > for (NetworkVertex vert : verticies) { > if (vert.getType() == > NetworkVertex.VertexType.STATION) { > Station vertStation = > vert.getStation(); > if (station == vertStation) { > // There is a link between the > companies! Hooray! > } > } > } > } > ... > > This seems to work for simple cases, however, I suspect > (without digging too much) that it will get blocked by > tokens, which I can't have. I bet it won't be too hard to > fix, tho. > > Mike > > > > On Wed, Aug 28, 2013 at 2:38 PM, brett > lentz<bre...@gm... <mailto:bre...@gm...>> > wrote: > > In order to do tile rotations, there is already logic > that is aware of the "exits" of a tile. There's also the > route suggestion code. > > It might be possible to leverage that same code to > create a route graph that enables detection of > destination runs. > > It probably needs a fair bit of work to adapt for this > purpose, but those are at least places in the code to > start looking. > > ---Brett. > > > ---Brett. > > > On Wed, Aug 28, 2013 at 9:50 AM, Chris > Shaffer<chr...@gm... > <mailto:chr...@gm...>> wrote: > > There are games where tokens do block destinations, > so whatever code > you write should allow for that possibility. There > are also games > where connections are considered complete as soon as > the tile is laid, > and others where the check occurs during the > relevant company's > operating turn. > > -- > Chris > > Please consider the environment before printing this > e-mail. > > > On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander > <out...@gm... > <mailto:out...@gm...>> wrote: > > Both Major Companies in 1856 and Foreign > Investors in 1880 have the idea of > > needing to reach a destination. Both are > implemented by having the game > > player use a special action to tell the game > engine that a connection has > > taken place. Once the connection exists, some > one time event occurs. It > > seems like if there is code that could be used to > determine if a connection > > exists, the game could automatically determine > that without relying on the > > player to tell it. > > > > So I actually want something slightly different > than what I said. It's not > > that the current company can make a run between > two hexes that I want to > > know, it's that a connection exists (regardless > of tokens). > > > > Mike > > > > > > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer > <chr...@gm... > <mailto:chr...@gm...>> > > wrote: > >> > >> Would this be for games where companies are > limited to building track > >> where their trains can actually reach, or some > other purpose? > >> > >> -- > >> Chris > >> > >> Please consider the environment before printing > this e-mail. > >> > >> > >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander > >> <out...@gm... > <mailto:out...@gm...>> wrote: > >> > Everyone, > >> > > >> > I'd like to add a check to see if the > currently operating company > >> > can > >> > run from specific MapHex to another. It seems > like there should be a > >> > way to > >> > do this, since a similar calculation would > have to be made when > >> > determining > >> > what MapHexs are eligible to have a tile > placed, but I can't seem to > >> > figure > >> > out how to do it. What am I missing? > >> > > >> > Thanks, > >> > > >> > Michael Alexander > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > Learn the latest--Visual Studio 2012, > SharePoint 2013, SQL 2012, more! > >> > Discover the easy way to master current and > previous Microsoft > >> > technologies > >> > and advance your career. Get an incredible > 1,500+ hours of step-by-step > >> > tutorial videos with LearnDevNow. Subscribe > today and save! > >> > > >> > >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> > >> > _______________________________________________ > >> > Rails-devel mailing list > >> >Rai...@li... > <mailto:Rai...@li...> > >> > >https://lists.sourceforge.net/lists/listinfo/rails-devel <https://lists.sourceforge.net/lists/listinfo/rails-devel> > >> > > >> > >> > >> > ------------------------------------------------------------------------------ > >> Learn the latest--Visual Studio 2012, SharePoint > 2013, SQL 2012, more! > >> Discover the easy way to master current and > previous Microsoft > >> technologies > >> and advance your career. Get an incredible > 1,500+ hours of step-by-step > >> tutorial videos with LearnDevNow. Subscribe > today and save! > >> > >>http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> > >> _______________________________________________ > >> Rails-devel mailing list > >>Rai...@li... > <mailto:Rai...@li...> > >>https://lists.sourceforge.net/lists/listinfo/rails-devel <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint > 2013, SQL 2012, more! > > Discover the easy way to master current and > previous Microsoft technologies > > and advance your career. Get an incredible 1,500+ > hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today > and save! > >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk <http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk> > > _______________________________________________ > > Rails-devel mailing list > >Rai...@li... > <mailto:Rai...@li...> > >https://lists.sourceforge.net/lists/listinfo/rails-devel <https://lists.sourceforge.net/lists/listinfo/rails-devel> > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint > 2013, SQL 2012, more! > Discover the easy way to master current and previous > Microsoft technologies > and advance your career. Get an incredible 1,500+ > hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today > and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > <mailto:Rai...@li...> > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, > SQL 2012, more! > Discover the easy way to master current and previous > Microsoft technologies > and advance your career. Get an incredible 1,500+ hours > of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > <mailto:Rai...@li...> > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft > technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > <mailto:Rai...@li...> > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Michael A. <out...@gm...> - 2013-08-29 12:18:40
|
How close is 2.0 to being ready to roll out? Should we be considering moving the 1880_specific branch to be under 2.0? On Thu, Aug 29, 2013 at 6:56 AM, Stefan Frey <ste...@we...> wrote: > You coded against Rail 1.x, this part of the code is upgraded in Rails 2.0 > branches. > Especially the connectivity functions are improved. If you check out Rails > 2.0 you will realize that it supports full verification of tile lays. > So I suggest that you code that functionally in 2.0 otherwise it will most > likely duplicate efforts and will not be mergeable. > > > Michael Alexander <out...@gm...> wrote: >> >> So what I found was that the NetworkIterator stopped at nodes that were >> sinks. If I want to be able to build a graph that just tells me that I'm >> connected and ignores tokens in the way, I think I need to add a setting to >> NetworkIterator to tell it if it should ignore sinks. As this is a >> complicated area of the code, and it's not limited to the 1880 specific >> areas, I'd appreciate some feedback on my proposed changes: >> >> diff --git a/rails/algorithms/NetworkCompanyGraph.java >> b/rails/algorithms/NetworkCompanyGraph.java >> index bd93113..0e5b2c8 100644 >> --- a/rails/algorithms/NetworkCompanyGraph.java >> +++ b/rails/algorithms/NetworkCompanyGraph.java >> @@ -64,7 +64,8 @@ >> return phase2Graph; >> } >> >> - public SimpleGraph<NetworkVertex, NetworkEdge> >> createRouteGraph(boolean addHQ) { >> + >> + private SimpleGraph<NetworkVertex, NetworkEdge> createGraph(boolean >> addHQ, boolean ignoreSinks) { >> // get mapgraph from builder >> SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = >> graphBuilder.getMapGraph(); >> >> @@ -88,7 +89,7 @@ >> // add connection to graph >> graph.addVertex(vertex); >> graph.addEdge(vertex, hqVertex, new NetworkEdge(vertex, >> hqVertex, false)); >> - NetworkIterator iterator = new NetworkIterator(mapGraph, >> vertex, company); >> + NetworkIterator iterator = new NetworkIterator(mapGraph, >> vertex, company, ignoreSinks); >> for (;iterator.hasNext();) >> vertexes.add(iterator.next()); >> // restore sink property >> @@ -112,6 +113,14 @@ >> return graph; >> } >> >> + public SimpleGraph<NetworkVertex, NetworkEdge> >> createRouteGraph(boolean addHQ) { >> + return createGraph(addHQ, false); >> + } >> + >> + public SimpleGraph<NetworkVertex, NetworkEdge> >> createConnectionGraph(boolean addHQ) { >> + return createGraph(addHQ, true); >> + } >> + >> public List<NetworkVertex> >> getCompanyBaseTokenVertexes(PublicCompanyI company) { >> List<NetworkVertex> vertexes = new ArrayList<NetworkVertex>(); >> for (TokenI token:company.getTokens()){ >> diff --git a/rails/algorithms/NetworkIterator.java >> b/rails/algorithms/NetworkIterator.java >> index f4029e8..1adc0a6 100644 >> --- a/rails/algorithms/NetworkIterator.java >> +++ b/rails/algorithms/NetworkIterator.java >> @@ -26,6 +26,7 @@ >> private NetworkVertex startVertex; >> private boolean startVertexVisited; >> private boolean routeIterator; >> + private boolean ignoreSinks; >> >> // internal data >> private List<NetworkVertex> stack = new ArrayList<NetworkVertex>(); >> @@ -41,14 +42,14 @@ >> >> public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, >> NetworkVertex startVertex) { >> - this(graph, startVertex, null); >> + this(graph, startVertex, null, false); >> } >> >> /** >> * Returns NetworkIterator for specific company >> */ >> public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, >> NetworkVertex startVertex, >> - PublicCompanyI company) { >> + PublicCompanyI company, boolean ignoreSinks) { >> super(); >> >> if (graph == null) >> @@ -61,6 +62,7 @@ >> this.startVertex = startVertex; >> this.startVertexVisited = false; >> this.routeIterator = false; >> + this.ignoreSinks = ignoreSinks; >> } >> >> NetworkIterator setRouteIterator(boolean routeIterator) { >> @@ -174,7 +176,7 @@ >> >> private void addUnseenChildrenOf(NetworkVertex vertex, boolean >> greedy) { >> >> - if (vertex.isSink()) return; >> + if (vertex.isSink() && (!ignoreSinks)) return; >> log.debug("Iterator: Add unseen children of " + vertex); >> >> for (NetworkEdge edge : graph.edgesOf(vertex)) { >> diff --git a/rails/algorithms/NetworkVertex.java >> b/rails/algorithms/NetworkVertex.java >> index 91356af..03045b9 100644 >> --- a/rails/algorithms/NetworkVertex.java >> +++ b/rails/algorithms/NetworkVertex.java >> @@ -311,7 +311,7 @@ >> */ >> public static void initAllRailsVertices(Graph<NetworkVertex, >> NetworkEdge> graph, >> PublicCompanyI company, PhaseI phase) { >> - >> + >> // store vertices for removal >> List<NetworkVertex> verticesToRemove = new >> ArrayList<NetworkVertex>(); >> for (NetworkVertex v:graph.vertexSet()) { >> >> >> On Wed, Aug 28, 2013 at 4:52 PM, Michael Alexander < >> out...@gm...> wrote: >> >>> Here's what I ended up with so far: >>> >>> compA is the private investor >>> compB is the company to check to see if there is a connection with >>> >>> PublicCompanyI compA = operatingCompany.get(); >>> ... >>> NetworkGraphBuilder nwGraph = >>> NetworkGraphBuilder.create(gameManager); >>> NetworkCompanyGraph companyGraph = >>> NetworkCompanyGraph.create(nwGraph, compA); >>> SimpleGraph<NetworkVertex, NetworkEdge> graph = >>> companyGraph.createRouteGraph(true); >>> Set<NetworkVertex> verticies = graph.vertexSet(); >>> ... >>> for (TokenI token : compB.getTokens()) { >>> TokenHolder holder = token.getHolder(); >>> if (!(holder instanceof Stop)) continue; >>> Stop city = (Stop) holder; >>> Station station = city.getRelatedStation(); >>> >>> for (NetworkVertex vert : verticies) { >>> if (vert.getType() == >>> NetworkVertex.VertexType.STATION) { >>> Station vertStation = vert.getStation(); >>> if (station == vertStation) { >>> // There is a link between the companies! >>> Hooray! >>> } >>> } >>> } >>> } >>> ... >>> >>> This seems to work for simple cases, however, I suspect (without >>> digging too much) that it will get blocked by tokens, which I can't have. >>> I bet it won't be too hard to fix, tho. >>> >>> Mike >>> >>> >>> >>> On Wed, Aug 28, 2013 at 2:38 PM, brett lentz <bre...@gm...>wrote: >>> >>>> In order to do tile rotations, there is already logic that is aware of >>>> the "exits" of a tile. There's also the route suggestion code. >>>> >>>> It might be possible to leverage that same code to create a route graph >>>> that enables detection of destination runs. >>>> >>>> It probably needs a fair bit of work to adapt for this purpose, but >>>> those are at least places in the code to start looking. >>>> >>>> ---Brett. >>>> >>>> >>>> ---Brett. >>>> >>>> >>>> On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer < >>>> chr...@gm...> wrote: >>>> >>>>> There are games where tokens do block destinations, so whatever code >>>>> you write should allow for that possibility. There are also games >>>>> where connections are considered complete as soon as the tile is laid, >>>>> and others where the check occurs during the relevant company's >>>>> operating turn. >>>>> >>>>> -- >>>>> Chris >>>>> >>>>> Please consider the environment before printing this e-mail. >>>>> >>>>> >>>>> On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander >>>>> <out...@gm...> wrote: >>>>> > Both Major Companies in 1856 and Foreign Investors in 1880 have the >>>>> idea of >>>>> > needing to reach a destination. Both are implemented by having the >>>>> game >>>>> > player use a special action to tell the game engine that a >>>>> connection has >>>>> > taken place. Once the connection exists, some one time event >>>>> occurs. It >>>>> > seems like if there is code that could be used to determine if a >>>>> connection >>>>> > exists, the game could automatically determine that without relying >>>>> on the >>>>> > player to tell it. >>>>> > >>>>> > So I actually want something slightly different than what I said. >>>>> It's not >>>>> > that the current company can make a run between two hexes that I >>>>> want to >>>>> > know, it's that a connection exists (regardless of tokens). >>>>> > >>>>> > Mike >>>>> > >>>>> > >>>>> > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer < >>>>> chr...@gm...> >>>>> > wrote: >>>>> >> >>>>> >> Would this be for games where companies are limited to building >>>>> track >>>>> >> where their trains can actually reach, or some other purpose? >>>>> >> >>>>> >> -- >>>>> >> Chris >>>>> >> >>>>> >> Please consider the environment before printing this e-mail. >>>>> >> >>>>> >> >>>>> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander >>>>> >> <out...@gm...> wrote: >>>>> >> > Everyone, >>>>> >> > >>>>> >> > I'd like to add a check to see if the currently operating >>>>> company >>>>> >> > can >>>>> >> > run from specific MapHex to another. It seems like there should >>>>> be a >>>>> >> > way to >>>>> >> > do this, since a similar calculation would have to be made when >>>>> >> > determining >>>>> >> > what MapHexs are eligible to have a tile placed, but I can't seem >>>>> to >>>>> >> > figure >>>>> >> > out how to do it. What am I missing? >>>>> >> > >>>>> >> > Thanks, >>>>> >> > >>>>> >> > Michael Alexander >>>>> >> > >>>>> >> > >>>>> >> > >>>>> ------------------------------------------------------------------------------ >>>>> >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >>>>> more! >>>>> >> > Discover the easy way to master current and previous Microsoft >>>>> >> > technologies >>>>> >> > and advance your career. Get an incredible 1,500+ hours of >>>>> step-by-step >>>>> >> > tutorial videos with LearnDevNow. Subscribe today and save! >>>>> >> > >>>>> >> >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>>> >> > _______________________________________________ >>>>> >> > Rails-devel mailing list >>>>> >> > Rai...@li... >>>>> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>>>> >> > >>>>> >> >>>>> >> >>>>> >> >>>>> ------------------------------------------------------------------------------ >>>>> >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >>>>> more! >>>>> >> Discover the easy way to master current and previous Microsoft >>>>> >> technologies >>>>> >> and advance your career. Get an incredible 1,500+ hours of >>>>> step-by-step >>>>> >> tutorial videos with LearnDevNow. Subscribe today and save! >>>>> >> >>>>> >>http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>>> >> _______________________________________________ >>>>> >> Rails-devel mailing list >>>>> >> Rai...@li... >>>>> >> https://lists.sourceforge.net/lists/listinfo/rails-devel >>>>> > >>>>> > >>>>> > >>>>> > >>>>> ------------------------------------------------------------------------------ >>>>> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >>>>> more! >>>>> > Discover the easy way to master current and previous Microsoft >>>>> technologies >>>>> > and advance your career. Get an incredible 1,500+ hours of >>>>> step-by-step >>>>> > tutorial videos with LearnDevNow. Subscribe today and save! >>>>> >http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>>> > _______________________________________________ >>>>> > Rails-devel mailing list >>>>> > Rai...@li... >>>>> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>>>> > >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>>> Discover the easy way to master current and previous Microsoft >>>>> technologies >>>>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>>>> tutorial videos with LearnDevNow. Subscribe today and save! >>>>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Rails-devel mailing list >>>>> Rai...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/rails-devel >>>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> Discover the easy way to master current and previous Microsoft >>>> technologies >>>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> tutorial videos with LearnDevNow. Subscribe today and save! >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Rails-devel mailing list >>>> Rai...@li... >>>> https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> >>>> >>> >> > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: Michael A. <out...@gm...> - 2013-08-29 12:17:32
|
I didn't delete one, I just added one parameter to one constructor. And eclipse didn't tell me anything broke, so I think I'm ok. :) On Thu, Aug 29, 2013 at 6:14 AM, Dr. Martin Brumm < dr....@t-...> wrote: > Hi Michael, > > Make sure that the deleted function isnt in use somewhere else :) > > Von meinem iPad gesendet > > Am 29.08.2013 um 07:27 schrieb Michael Alexander <out...@gm... > >: > > So what I found was that the NetworkIterator stopped at nodes that were > sinks. If I want to be able to build a graph that just tells me that I'm > connected and ignores tokens in the way, I think I need to add a setting to > NetworkIterator to tell it if it should ignore sinks. As this is a > complicated area of the code, and it's not limited to the 1880 specific > areas, I'd appreciate some feedback on my proposed changes: > > diff --git a/rails/algorithms/NetworkCompanyGraph.java > b/rails/algorithms/NetworkCompanyGraph.java > index bd93113..0e5b2c8 100644 > --- a/rails/algorithms/NetworkCompanyGraph.java > +++ b/rails/algorithms/NetworkCompanyGraph.java > @@ -64,7 +64,8 @@ > return phase2Graph; > } > > - public SimpleGraph<NetworkVertex, NetworkEdge> > createRouteGraph(boolean addHQ) { > + > + private SimpleGraph<NetworkVertex, NetworkEdge> createGraph(boolean > addHQ, boolean ignoreSinks) { > // get mapgraph from builder > SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = > graphBuilder.getMapGraph(); > > @@ -88,7 +89,7 @@ > // add connection to graph > graph.addVertex(vertex); > graph.addEdge(vertex, hqVertex, new NetworkEdge(vertex, > hqVertex, false)); > - NetworkIterator iterator = new NetworkIterator(mapGraph, > vertex, company); > + NetworkIterator iterator = new NetworkIterator(mapGraph, > vertex, company, ignoreSinks); > for (;iterator.hasNext();) > vertexes.add(iterator.next()); > // restore sink property > @@ -112,6 +113,14 @@ > return graph; > } > > + public SimpleGraph<NetworkVertex, NetworkEdge> > createRouteGraph(boolean addHQ) { > + return createGraph(addHQ, false); > + } > + > + public SimpleGraph<NetworkVertex, NetworkEdge> > createConnectionGraph(boolean addHQ) { > + return createGraph(addHQ, true); > + } > + > public List<NetworkVertex> getCompanyBaseTokenVertexes(PublicCompanyI > company) { > List<NetworkVertex> vertexes = new ArrayList<NetworkVertex>(); > for (TokenI token:company.getTokens()){ > diff --git a/rails/algorithms/NetworkIterator.java > b/rails/algorithms/NetworkIterator.java > index f4029e8..1adc0a6 100644 > --- a/rails/algorithms/NetworkIterator.java > +++ b/rails/algorithms/NetworkIterator.java > @@ -26,6 +26,7 @@ > private NetworkVertex startVertex; > private boolean startVertexVisited; > private boolean routeIterator; > + private boolean ignoreSinks; > > // internal data > private List<NetworkVertex> stack = new ArrayList<NetworkVertex>(); > @@ -41,14 +42,14 @@ > > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, > NetworkVertex startVertex) { > - this(graph, startVertex, null); > + this(graph, startVertex, null, false); > } > > /** > * Returns NetworkIterator for specific company > */ > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, > NetworkVertex startVertex, > - PublicCompanyI company) { > + PublicCompanyI company, boolean ignoreSinks) { > super(); > > if (graph == null) > @@ -61,6 +62,7 @@ > this.startVertex = startVertex; > this.startVertexVisited = false; > this.routeIterator = false; > + this.ignoreSinks = ignoreSinks; > } > > NetworkIterator setRouteIterator(boolean routeIterator) { > @@ -174,7 +176,7 @@ > > private void addUnseenChildrenOf(NetworkVertex vertex, boolean > greedy) { > > - if (vertex.isSink()) return; > + if (vertex.isSink() && (!ignoreSinks)) return; > log.debug("Iterator: Add unseen children of " + vertex); > > for (NetworkEdge edge : graph.edgesOf(vertex)) { > diff --git a/rails/algorithms/NetworkVertex.java > b/rails/algorithms/NetworkVertex.java > index 91356af..03045b9 100644 > --- a/rails/algorithms/NetworkVertex.java > +++ b/rails/algorithms/NetworkVertex.java > @@ -311,7 +311,7 @@ > */ > public static void initAllRailsVertices(Graph<NetworkVertex, > NetworkEdge> graph, > PublicCompanyI company, PhaseI phase) { > - > + > // store vertices for removal > List<NetworkVertex> verticesToRemove = new > ArrayList<NetworkVertex>(); > for (NetworkVertex v:graph.vertexSet()) { > > > On Wed, Aug 28, 2013 at 4:52 PM, Michael Alexander < > out...@gm...> wrote: > >> Here's what I ended up with so far: >> >> compA is the private investor >> compB is the company to check to see if there is a connection with >> >> PublicCompanyI compA = operatingCompany.get(); >> ... >> NetworkGraphBuilder nwGraph = >> NetworkGraphBuilder.create(gameManager); >> NetworkCompanyGraph companyGraph = >> NetworkCompanyGraph.create(nwGraph, compA); >> SimpleGraph<NetworkVertex, NetworkEdge> graph = >> companyGraph.createRouteGraph(true); >> Set<NetworkVertex> verticies = graph.vertexSet(); >> ... >> for (TokenI token : compB.getTokens()) { >> TokenHolder holder = token.getHolder(); >> if (!(holder instanceof Stop)) continue; >> Stop city = (Stop) holder; >> Station station = city.getRelatedStation(); >> >> for (NetworkVertex vert : verticies) { >> if (vert.getType() == >> NetworkVertex.VertexType.STATION) { >> Station vertStation = vert.getStation(); >> if (station == vertStation) { >> // There is a link between the companies! >> Hooray! >> } >> } >> } >> } >> ... >> >> This seems to work for simple cases, however, I suspect (without digging >> too much) that it will get blocked by tokens, which I can't have. I bet it >> won't be too hard to fix, tho. >> >> Mike >> >> >> >> On Wed, Aug 28, 2013 at 2:38 PM, brett lentz <bre...@gm...>wrote: >> >>> In order to do tile rotations, there is already logic that is aware of >>> the "exits" of a tile. There's also the route suggestion code. >>> >>> It might be possible to leverage that same code to create a route graph >>> that enables detection of destination runs. >>> >>> It probably needs a fair bit of work to adapt for this purpose, but >>> those are at least places in the code to start looking. >>> >>> ---Brett. >>> >>> >>> ---Brett. >>> >>> >>> On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer <chr...@gm...>wrote: >>> >>>> There are games where tokens do block destinations, so whatever code >>>> you write should allow for that possibility. There are also games >>>> where connections are considered complete as soon as the tile is laid, >>>> and others where the check occurs during the relevant company's >>>> operating turn. >>>> >>>> -- >>>> Chris >>>> >>>> Please consider the environment before printing this e-mail. >>>> >>>> >>>> On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander >>>> <out...@gm...> wrote: >>>> > Both Major Companies in 1856 and Foreign Investors in 1880 have the >>>> idea of >>>> > needing to reach a destination. Both are implemented by having the >>>> game >>>> > player use a special action to tell the game engine that a connection >>>> has >>>> > taken place. Once the connection exists, some one time event occurs. >>>> It >>>> > seems like if there is code that could be used to determine if a >>>> connection >>>> > exists, the game could automatically determine that without relying >>>> on the >>>> > player to tell it. >>>> > >>>> > So I actually want something slightly different than what I said. >>>> It's not >>>> > that the current company can make a run between two hexes that I want >>>> to >>>> > know, it's that a connection exists (regardless of tokens). >>>> > >>>> > Mike >>>> > >>>> > >>>> > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer < >>>> chr...@gm...> >>>> > wrote: >>>> >> >>>> >> Would this be for games where companies are limited to building track >>>> >> where their trains can actually reach, or some other purpose? >>>> >> >>>> >> -- >>>> >> Chris >>>> >> >>>> >> Please consider the environment before printing this e-mail. >>>> >> >>>> >> >>>> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander >>>> >> <out...@gm...> wrote: >>>> >> > Everyone, >>>> >> > >>>> >> > I'd like to add a check to see if the currently operating >>>> company >>>> >> > can >>>> >> > run from specific MapHex to another. It seems like there should >>>> be a >>>> >> > way to >>>> >> > do this, since a similar calculation would have to be made when >>>> >> > determining >>>> >> > what MapHexs are eligible to have a tile placed, but I can't seem >>>> to >>>> >> > figure >>>> >> > out how to do it. What am I missing? >>>> >> > >>>> >> > Thanks, >>>> >> > >>>> >> > Michael Alexander >>>> >> > >>>> >> > >>>> >> > >>>> ------------------------------------------------------------------------------ >>>> >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >>>> more! >>>> >> > Discover the easy way to master current and previous Microsoft >>>> >> > technologies >>>> >> > and advance your career. Get an incredible 1,500+ hours of >>>> step-by-step >>>> >> > tutorial videos with LearnDevNow. Subscribe today and save! >>>> >> > >>>> >> > >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> >> > _______________________________________________ >>>> >> > Rails-devel mailing list >>>> >> > Rai...@li... >>>> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> >> > >>>> >> >>>> >> >>>> >> >>>> ------------------------------------------------------------------------------ >>>> >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >>>> more! >>>> >> Discover the easy way to master current and previous Microsoft >>>> >> technologies >>>> >> and advance your career. Get an incredible 1,500+ hours of >>>> step-by-step >>>> >> tutorial videos with LearnDevNow. Subscribe today and save! >>>> >> >>>> >> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> >> _______________________________________________ >>>> >> Rails-devel mailing list >>>> >> Rai...@li... >>>> >> https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> > >>>> > >>>> > >>>> > >>>> ------------------------------------------------------------------------------ >>>> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> > Discover the easy way to master current and previous Microsoft >>>> technologies >>>> > and advance your career. Get an incredible 1,500+ hours of >>>> step-by-step >>>> > tutorial videos with LearnDevNow. Subscribe today and save! >>>> > >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> > _______________________________________________ >>>> > Rails-devel mailing list >>>> > Rai...@li... >>>> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> > >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> Discover the easy way to master current and previous Microsoft >>>> technologies >>>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> tutorial videos with LearnDevNow. Subscribe today and save! >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Rails-devel mailing list >>>> Rai...@li... >>>> https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>> Discover the easy way to master current and previous Microsoft >>> technologies >>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>> tutorial videos with LearnDevNow. Subscribe today and save! >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Rails-devel mailing list >>> Rai...@li... >>> https://lists.sourceforge.net/lists/listinfo/rails-devel >>> >>> >> > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: Stefan F. <ste...@we...> - 2013-08-29 10:56:14
|
<html> <head> </head> <body>You coded against Rail 1.x, this part of the code is upgraded in Rails 2.0 branches.<br> Especially the connectivity functions are improved. If you check out Rails 2.0 you will realize that it supports full verification of tile lays. <br> So I suggest that you code that functionally in 2.0 otherwise it will most likely duplicate efforts and will not be mergeable. <br> <br><br><div class="gmail_quote">Michael Alexander <out...@gm...> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div> So what I found was that the NetworkIterator stopped at nodes that were sinks. If I want to be able to build a graph that just tells me that I'm connected and ignores tokens in the way, I think I need to add a setting to NetworkIterator to tell it if it should ignore sinks. As this is a complicated area of the code, and it's not limited to the 1880 specific areas, I'd appreciate some feedback on my proposed changes:<br/> <br/> diff --git a/rails/algorithms/NetworkCompanyGraph.java b/rails/algorithms/NetworkCompanyGraph.java<br/> index bd93113..0e5b2c8 100644<br/> --- a/rails/algorithms/NetworkCompanyGraph.java<br/> +++ b/rails/algorithms/NetworkCompanyGraph.java<br/> @@ -64,7 +64,8 @@<br/> return phase2Graph;<br/> }<br/> <br/> - public SimpleGraph<NetworkVertex, NetworkEdge> createRouteGraph(boolean addHQ) {<br/> + <br/> + private SimpleGraph<NetworkVertex, NetworkEdge> createGraph(boolean addHQ, boolean ignoreSinks) {<br/> // get mapgraph from builder<br/> SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = graphBuilder.getMapGraph();<br/> <br/> @@ -88,7 +89,7 @@<br/> // add connection to graph<br/> graph.addVertex(vertex);<br/> graph.addEdge(vertex, hqVertex, new NetworkEdge(vertex, hqVertex, false));<br/> - NetworkIterator iterator = new NetworkIterator(mapGraph, vertex, company);<br/> + NetworkIterator iterator = new NetworkIterator(mapGraph, vertex, company, ignoreSinks);<br/> for (;iterator.hasNext();)<br/> vertexes.add(iterator.next());<br/> // restore sink property<br/> @@ -112,6 +113,14 @@<br/> return graph;<br/> }<br/> <br/> + public SimpleGraph<NetworkVertex, NetworkEdge> createRouteGraph(boolean addHQ) {<br/> + return createGraph(addHQ, false);<br/> + }<br/> +<br/> + public SimpleGraph<NetworkVertex, NetworkEdge> createConnectionGraph(boolean addHQ) {<br/> + return createGraph(addHQ, true);<br/> + }<br/> + <br/> public List<NetworkVertex> getCompanyBaseTokenVertexes(PublicCompanyI company) {<br/> List<NetworkVertex> vertexes = new ArrayList<NetworkVertex>();<br/> for (TokenI token:company.getTokens()){<br/> diff --git a/rails/algorithms/NetworkIterator.java b/rails/algorithms/NetworkIterator.java<br/> index f4029e8..1adc0a6 100644<br/> --- a/rails/algorithms/NetworkIterator.java<br/> +++ b/rails/algorithms/NetworkIterator.java<br/> @@ -26,6 +26,7 @@<br/> private NetworkVertex startVertex;<br/> private boolean startVertexVisited;<br/> private boolean routeIterator;<br/> + private boolean ignoreSinks;<br/> <br/> // internal data<br/> private List<NetworkVertex> stack = new ArrayList<NetworkVertex>();<br/> @@ -41,14 +42,14 @@<br/> <br/> public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph,<br/> NetworkVertex startVertex) {<br/> - this(graph, startVertex, null);<br/> + this(graph, startVertex, null, false);<br/> }<br/> <br/> /**<br/> * Returns NetworkIterator for specific company<br/> */<br/> public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, NetworkVertex startVertex,<br/> - PublicCompanyI company) {<br/> + PublicCompanyI company, boolean ignoreSinks) {<br/> super();<br/> <br/> if (graph == null)<br/> @@ -61,6 +62,7 @@<br/> this.startVertex = startVertex;<br/> this.startVertexVisited = false;<br/> this.routeIterator = false;<br/> + this.ignoreSinks = ignoreSinks;<br/> }<br/> <br/> NetworkIterator setRouteIterator(boolean routeIterator) {<br/> @@ -174,7 +176,7 @@<br/> <br/> private void addUnseenChildrenOf(NetworkVertex vertex, boolean greedy) {<br/> <br/> - if (vertex.isSink()) return;<br/> + if (vertex.isSink() && (!ignoreSinks)) return;<br/> log.debug("Iterator: Add unseen children of " + vertex);<br/> <br/> for (NetworkEdge edge : graph.edgesOf(vertex)) {<br/> diff --git a/rails/algorithms/NetworkVertex.java b/rails/algorithms/NetworkVertex.java<br/> index 91356af..03045b9 100644<br/> --- a/rails/algorithms/NetworkVertex.java<br/> +++ b/rails/algorithms/NetworkVertex.java<br/> @@ -311,7 +311,7 @@<br/> */<br/> public static void initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph,<br/> PublicCompanyI company, PhaseI phase) {<br/> -<br/> + <br/> // store vertices for removal<br/> List<NetworkVertex> verticesToRemove = new ArrayList<NetworkVertex>();<br/> for (NetworkVertex v:graph.vertexSet()) {<br/> </div> <div class="gmail_extra"> <br/> <br/> <div class="gmail_quote"> On Wed, Aug 28, 2013 at 4:52 PM, Michael Alexander<span> <<a href="mailto:out...@gm..." target="_blank">out...@gm...</a>></span> wrote:<br/> <blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;"> <div> <div> Here's what I ended up with so far:<br/> <br/> </div> <div> compA is the private investor<br/> </div> <div> compB is the company to check to see if there is a connection with<br/> </div> <div> <br/> PublicCompanyI compA = operatingCompany.get();<br/> ...<br/> NetworkGraphBuilder nwGraph = NetworkGraphBuilder.create(gameManager);<br/> NetworkCompanyGraph companyGraph = NetworkCompanyGraph.create(nwGraph, compA);<br/> SimpleGraph<NetworkVertex, NetworkEdge> graph = companyGraph.createRouteGraph(true);<br/> Set<NetworkVertex> verticies = graph.vertexSet();<br/> ...<br/> for (TokenI token : compB.getTokens()) {<br/> TokenHolder holder = token.getHolder();<br/> if (!(holder instanceof Stop)) continue;<br/> Stop city = (Stop) holder;<br/> Station station = city.getRelatedStation();<br/> <br/> for (NetworkVertex vert : verticies) {<br/> if (vert.getType() == NetworkVertex.VertexType.STATION) {<br/> Station vertStation = vert.getStation();<br/> if (station == vertStation) {<br/> </div> // There is a link between the companies! Hooray!<br/> <div> }<br/> }<br/> }<br/> }<br/> ...<br/> <br/> </div> <div> This seems to work for simple cases, however, I suspect (without digging too much) that it will get blocked by tokens, which I can't have. I bet it won't be too hard to fix, tho.<br/> <br/> Mike<br/> </div> <div> <br/> </div> </div> <div class="HOEnZb"> <div class="h5"> <div class="gmail_extra"> <br/> <br/> <div class="gmail_quote"> On Wed, Aug 28, 2013 at 2:38 PM, brett lentz<span> <<a href="mailto:bre...@gm..." target="_blank">bre...@gm...</a>></span> wrote:<br/> <blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;"> <div> In order to do tile rotations, there is already logic that is aware of the "exits" of a tile. There's also the route suggestion code.<br/> <br/> It might be possible to leverage that same code to create a route graph that enables detection of destination runs.<br/> <br/> It probably needs a fair bit of work to adapt for this purpose, but those are at least places in the code to start looking. <div> <br/> </div> <div> ---Brett. </div> </div> <div class="gmail_extra"> <span><font color="#888888"><br clear="all"/> <div> <br/> ---Brett. </div> </font></span> <div> <div> <br/> <br/> <div class="gmail_quote"> On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer<span> <<a href="mailto:chr...@gm..." target="_blank">chr...@gm...</a>></span> wrote:<br/> <blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;"> There are games where tokens do block destinations, so whatever code<br/> you write should allow for that possibility. There are also games<br/> where connections are considered complete as soon as the tile is laid,<br/> and others where the check occurs during the relevant company's<br/> operating turn.<br/> <div> <br/> --<br/> Chris<br/> <br/> Please consider the environment before printing this e-mail.<br/> <br/> <br/> </div> <div> <div> On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander<br/> <<a href="mailto:out...@gm..." target="_blank">out...@gm...</a>> wrote:<br/> > Both Major Companies in 1856 and Foreign Investors in 1880 have the idea of<br/> > needing to reach a destination. Both are implemented by having the game<br/> > player use a special action to tell the game engine that a connection has<br/> > taken place. Once the connection exists, some one time event occurs. It<br/> > seems like if there is code that could be used to determine if a connection<br/> > exists, the game could automatically determine that without relying on the<br/> > player to tell it.<br/> ><br/> > So I actually want something slightly different than what I said. It's not<br/> > that the current company can make a run between two hexes that I want to<br/> > know, it's that a connection exists (regardless of tokens).<br/> ><br/> > Mike<br/> ><br/> ><br/> > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer <<a href="mailto:chr...@gm..." target="_blank">chr...@gm...</a>><br/> > wrote:<br/> >><br/> >> Would this be for games where companies are limited to building track<br/> >> where their trains can actually reach, or some other purpose?<br/> >><br/> >> --<br/> >> Chris<br/> >><br/> >> Please consider the environment before printing this e-mail.<br/> >><br/> >><br/> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander<br/> >> <<a href="mailto:out...@gm..." target="_blank">out...@gm...</a>> wrote:<br/> >> > Everyone,<br/> >> ><br/> >> > I'd like to add a check to see if the currently operating company<br/> >> > can<br/> >> > run from specific MapHex to another. It seems like there should be a<br/> >> > way to<br/> >> > do this, since a similar calculation would have to be made when<br/> >> > determining<br/> >> > what MapHexs are eligible to have a tile placed, but I can't seem to<br/> >> > figure<br/> >> > out how to do it. What am I missing?<br/> >> ><br/> >> > Thanks,<br/> >> ><br/> >> > Michael Alexander<br/> >> ><br/> >> ><br/> >> > ------------------------------------------------------------------------------<br/> >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br/> >> > Discover the easy way to master current and previous Microsoft<br/> >> > technologies<br/> >> > and advance your career. Get an incredible 1,500+ hours of step-by-step<br/> >> > tutorial videos with LearnDevNow. Subscribe today and save!<br/> >> ><br/> >> ><a href="http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk" target="_blank"> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk</a><br/> >> > _______________________________________________<br/> >> > Rails-devel mailing list<br/> >> ><a href="mailto:Rai...@li..." target="_blank"> Rai...@li...</a><br/> >> ><a href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target="_blank"> https://lists.sourceforge.net/lists/listinfo/rails-devel</a><br/> >> ><br/> >><br/> >><br/> >> ------------------------------------------------------------------------------<br/> >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br/> >> Discover the easy way to master current and previous Microsoft<br/> >> technologies<br/> >> and advance your career. Get an incredible 1,500+ hours of step-by-step<br/> >> tutorial videos with LearnDevNow. Subscribe today and save!<br/> >><br/> >><a href="http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk" target="_blank"> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk</a><br/> >> _______________________________________________<br/> >> Rails-devel mailing list<br/> >><a href="mailto:Rai...@li..." target="_blank"> Rai...@li...</a><br/> >><a href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target="_blank"> https://lists.sourceforge.net/lists/listinfo/rails-devel</a><br/> ><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br/> > Discover the easy way to master current and previous Microsoft technologies<br/> > and advance your career. Get an incredible 1,500+ hours of step-by-step<br/> > tutorial videos with LearnDevNow. Subscribe today and save!<br/> ><a href="http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk" target="_blank"> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk</a><br/> > _______________________________________________<br/> > Rails-devel mailing list<br/> ><a href="mailto:Rai...@li..." target="_blank"> Rai...@li...</a><br/> ><a href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target="_blank"> https://lists.sourceforge.net/lists/listinfo/rails-devel</a><br/> ><br/> <br/> ------------------------------------------------------------------------------<br/> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br/> Discover the easy way to master current and previous Microsoft technologies<br/> and advance your career. Get an incredible 1,500+ hours of step-by-step<br/> tutorial videos with LearnDevNow. Subscribe today and save!<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk</a><br/> _______________________________________________<br/> Rails-devel mailing list<br/> <a href="mailto:Rai...@li..." target="_blank">Rai...@li...</a><br/> <a href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/rails-devel</a><br/> </div> </div> </blockquote> </div> <br/> </div> </div> </div> <br/> ------------------------------------------------------------------------------<br/> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br/> Discover the easy way to master current and previous Microsoft technologies<br/> and advance your career. Get an incredible 1,500+ hours of step-by-step<br/> tutorial videos with LearnDevNow. Subscribe today and save!<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk</a><br/> _______________________________________________<br/> Rails-devel mailing list<br/> <a href="mailto:Rai...@li..." target="_blank">Rai...@li...</a><br/> <a href="https://lists.sourceforge.net/lists/listinfo/rails-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/rails-devel</a><br/> <br/> </blockquote> </div> <br/> </div> </div> </div> </blockquote> </div> <br/> </div> </blockquote></div></body> </html> |
From: Dr. M. B. <dr....@t-...> - 2013-08-29 10:15:04
|
Hi Michael, Make sure that the deleted function isnt in use somewhere else :) Von meinem iPad gesendet Am 29.08.2013 um 07:27 schrieb Michael Alexander <out...@gm...>: > So what I found was that the NetworkIterator stopped at nodes that were sinks. If I want to be able to build a graph that just tells me that I'm connected and ignores tokens in the way, I think I need to add a setting to NetworkIterator to tell it if it should ignore sinks. As this is a complicated area of the code, and it's not limited to the 1880 specific areas, I'd appreciate some feedback on my proposed changes: > > diff --git a/rails/algorithms/NetworkCompanyGraph.java b/rails/algorithms/NetworkCompanyGraph.java > index bd93113..0e5b2c8 100644 > --- a/rails/algorithms/NetworkCompanyGraph.java > +++ b/rails/algorithms/NetworkCompanyGraph.java > @@ -64,7 +64,8 @@ > return phase2Graph; > } > > - public SimpleGraph<NetworkVertex, NetworkEdge> createRouteGraph(boolean addHQ) { > + > + private SimpleGraph<NetworkVertex, NetworkEdge> createGraph(boolean addHQ, boolean ignoreSinks) { > // get mapgraph from builder > SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = graphBuilder.getMapGraph(); > > @@ -88,7 +89,7 @@ > // add connection to graph > graph.addVertex(vertex); > graph.addEdge(vertex, hqVertex, new NetworkEdge(vertex, hqVertex, false)); > - NetworkIterator iterator = new NetworkIterator(mapGraph, vertex, company); > + NetworkIterator iterator = new NetworkIterator(mapGraph, vertex, company, ignoreSinks); > for (;iterator.hasNext();) > vertexes.add(iterator.next()); > // restore sink property > @@ -112,6 +113,14 @@ > return graph; > } > > + public SimpleGraph<NetworkVertex, NetworkEdge> createRouteGraph(boolean addHQ) { > + return createGraph(addHQ, false); > + } > + > + public SimpleGraph<NetworkVertex, NetworkEdge> createConnectionGraph(boolean addHQ) { > + return createGraph(addHQ, true); > + } > + > public List<NetworkVertex> getCompanyBaseTokenVertexes(PublicCompanyI company) { > List<NetworkVertex> vertexes = new ArrayList<NetworkVertex>(); > for (TokenI token:company.getTokens()){ > diff --git a/rails/algorithms/NetworkIterator.java b/rails/algorithms/NetworkIterator.java > index f4029e8..1adc0a6 100644 > --- a/rails/algorithms/NetworkIterator.java > +++ b/rails/algorithms/NetworkIterator.java > @@ -26,6 +26,7 @@ > private NetworkVertex startVertex; > private boolean startVertexVisited; > private boolean routeIterator; > + private boolean ignoreSinks; > > // internal data > private List<NetworkVertex> stack = new ArrayList<NetworkVertex>(); > @@ -41,14 +42,14 @@ > > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, > NetworkVertex startVertex) { > - this(graph, startVertex, null); > + this(graph, startVertex, null, false); > } > > /** > * Returns NetworkIterator for specific company > */ > public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, NetworkVertex startVertex, > - PublicCompanyI company) { > + PublicCompanyI company, boolean ignoreSinks) { > super(); > > if (graph == null) > @@ -61,6 +62,7 @@ > this.startVertex = startVertex; > this.startVertexVisited = false; > this.routeIterator = false; > + this.ignoreSinks = ignoreSinks; > } > > NetworkIterator setRouteIterator(boolean routeIterator) { > @@ -174,7 +176,7 @@ > > private void addUnseenChildrenOf(NetworkVertex vertex, boolean greedy) { > > - if (vertex.isSink()) return; > + if (vertex.isSink() && (!ignoreSinks)) return; > log.debug("Iterator: Add unseen children of " + vertex); > > for (NetworkEdge edge : graph.edgesOf(vertex)) { > diff --git a/rails/algorithms/NetworkVertex.java b/rails/algorithms/NetworkVertex.java > index 91356af..03045b9 100644 > --- a/rails/algorithms/NetworkVertex.java > +++ b/rails/algorithms/NetworkVertex.java > @@ -311,7 +311,7 @@ > */ > public static void initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph, > PublicCompanyI company, PhaseI phase) { > - > + > // store vertices for removal > List<NetworkVertex> verticesToRemove = new ArrayList<NetworkVertex>(); > for (NetworkVertex v:graph.vertexSet()) { > > > On Wed, Aug 28, 2013 at 4:52 PM, Michael Alexander <out...@gm...> wrote: >> Here's what I ended up with so far: >> >> compA is the private investor >> compB is the company to check to see if there is a connection with >> >> PublicCompanyI compA = operatingCompany.get(); >> ... >> NetworkGraphBuilder nwGraph = NetworkGraphBuilder.create(gameManager); >> NetworkCompanyGraph companyGraph = NetworkCompanyGraph.create(nwGraph, compA); >> SimpleGraph<NetworkVertex, NetworkEdge> graph = companyGraph.createRouteGraph(true); >> Set<NetworkVertex> verticies = graph.vertexSet(); >> ... >> for (TokenI token : compB.getTokens()) { >> TokenHolder holder = token.getHolder(); >> if (!(holder instanceof Stop)) continue; >> Stop city = (Stop) holder; >> Station station = city.getRelatedStation(); >> >> for (NetworkVertex vert : verticies) { >> if (vert.getType() == NetworkVertex.VertexType.STATION) { >> Station vertStation = vert.getStation(); >> if (station == vertStation) { >> // There is a link between the companies! Hooray! >> } >> } >> } >> } >> ... >> >> This seems to work for simple cases, however, I suspect (without digging too much) that it will get blocked by tokens, which I can't have. I bet it won't be too hard to fix, tho. >> >> Mike >> >> >> >> On Wed, Aug 28, 2013 at 2:38 PM, brett lentz <bre...@gm...> wrote: >>> In order to do tile rotations, there is already logic that is aware of the "exits" of a tile. There's also the route suggestion code. >>> >>> It might be possible to leverage that same code to create a route graph that enables detection of destination runs. >>> >>> It probably needs a fair bit of work to adapt for this purpose, but those are at least places in the code to start looking. >>> >>> ---Brett. >>> >>> >>> ---Brett. >>> >>> >>> On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer <chr...@gm...> wrote: >>>> There are games where tokens do block destinations, so whatever code >>>> you write should allow for that possibility. There are also games >>>> where connections are considered complete as soon as the tile is laid, >>>> and others where the check occurs during the relevant company's >>>> operating turn. >>>> >>>> -- >>>> Chris >>>> >>>> Please consider the environment before printing this e-mail. >>>> >>>> >>>> On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander >>>> <out...@gm...> wrote: >>>> > Both Major Companies in 1856 and Foreign Investors in 1880 have the idea of >>>> > needing to reach a destination. Both are implemented by having the game >>>> > player use a special action to tell the game engine that a connection has >>>> > taken place. Once the connection exists, some one time event occurs. It >>>> > seems like if there is code that could be used to determine if a connection >>>> > exists, the game could automatically determine that without relying on the >>>> > player to tell it. >>>> > >>>> > So I actually want something slightly different than what I said. It's not >>>> > that the current company can make a run between two hexes that I want to >>>> > know, it's that a connection exists (regardless of tokens). >>>> > >>>> > Mike >>>> > >>>> > >>>> > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer <chr...@gm...> >>>> > wrote: >>>> >> >>>> >> Would this be for games where companies are limited to building track >>>> >> where their trains can actually reach, or some other purpose? >>>> >> >>>> >> -- >>>> >> Chris >>>> >> >>>> >> Please consider the environment before printing this e-mail. >>>> >> >>>> >> >>>> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander >>>> >> <out...@gm...> wrote: >>>> >> > Everyone, >>>> >> > >>>> >> > I'd like to add a check to see if the currently operating company >>>> >> > can >>>> >> > run from specific MapHex to another. It seems like there should be a >>>> >> > way to >>>> >> > do this, since a similar calculation would have to be made when >>>> >> > determining >>>> >> > what MapHexs are eligible to have a tile placed, but I can't seem to >>>> >> > figure >>>> >> > out how to do it. What am I missing? >>>> >> > >>>> >> > Thanks, >>>> >> > >>>> >> > Michael Alexander >>>> >> > >>>> >> > >>>> >> > ------------------------------------------------------------------------------ >>>> >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> >> > Discover the easy way to master current and previous Microsoft >>>> >> > technologies >>>> >> > and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> >> > tutorial videos with LearnDevNow. Subscribe today and save! >>>> >> > >>>> >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> >> > _______________________________________________ >>>> >> > Rails-devel mailing list >>>> >> > Rai...@li... >>>> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> >> > >>>> >> >>>> >> >>>> >> ------------------------------------------------------------------------------ >>>> >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> >> Discover the easy way to master current and previous Microsoft >>>> >> technologies >>>> >> and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> >> tutorial videos with LearnDevNow. Subscribe today and save! >>>> >> >>>> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> >> _______________________________________________ >>>> >> Rails-devel mailing list >>>> >> Rai...@li... >>>> >> https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> > >>>> > >>>> > >>>> > ------------------------------------------------------------------------------ >>>> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> > Discover the easy way to master current and previous Microsoft technologies >>>> > and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> > tutorial videos with LearnDevNow. Subscribe today and save! >>>> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> > _______________________________________________ >>>> > Rails-devel mailing list >>>> > Rai...@li... >>>> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>>> > >>>> >>>> ------------------------------------------------------------------------------ >>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> Discover the easy way to master current and previous Microsoft technologies >>>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> tutorial videos with LearnDevNow. Subscribe today and save! >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Rails-devel mailing list >>>> Rai...@li... >>>> https://lists.sourceforge.net/lists/listinfo/rails-devel >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>> Discover the easy way to master current and previous Microsoft technologies >>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>> tutorial videos with LearnDevNow. Subscribe today and save! >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Rails-devel mailing list >>> Rai...@li... >>> https://lists.sourceforge.net/lists/listinfo/rails-devel > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Michael A. <out...@gm...> - 2013-08-29 05:27:58
|
So what I found was that the NetworkIterator stopped at nodes that were sinks. If I want to be able to build a graph that just tells me that I'm connected and ignores tokens in the way, I think I need to add a setting to NetworkIterator to tell it if it should ignore sinks. As this is a complicated area of the code, and it's not limited to the 1880 specific areas, I'd appreciate some feedback on my proposed changes: diff --git a/rails/algorithms/NetworkCompanyGraph.java b/rails/algorithms/NetworkCompanyGraph.java index bd93113..0e5b2c8 100644 --- a/rails/algorithms/NetworkCompanyGraph.java +++ b/rails/algorithms/NetworkCompanyGraph.java @@ -64,7 +64,8 @@ return phase2Graph; } - public SimpleGraph<NetworkVertex, NetworkEdge> createRouteGraph(boolean addHQ) { + + private SimpleGraph<NetworkVertex, NetworkEdge> createGraph(boolean addHQ, boolean ignoreSinks) { // get mapgraph from builder SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = graphBuilder.getMapGraph(); @@ -88,7 +89,7 @@ // add connection to graph graph.addVertex(vertex); graph.addEdge(vertex, hqVertex, new NetworkEdge(vertex, hqVertex, false)); - NetworkIterator iterator = new NetworkIterator(mapGraph, vertex, company); + NetworkIterator iterator = new NetworkIterator(mapGraph, vertex, company, ignoreSinks); for (;iterator.hasNext();) vertexes.add(iterator.next()); // restore sink property @@ -112,6 +113,14 @@ return graph; } + public SimpleGraph<NetworkVertex, NetworkEdge> createRouteGraph(boolean addHQ) { + return createGraph(addHQ, false); + } + + public SimpleGraph<NetworkVertex, NetworkEdge> createConnectionGraph(boolean addHQ) { + return createGraph(addHQ, true); + } + public List<NetworkVertex> getCompanyBaseTokenVertexes(PublicCompanyI company) { List<NetworkVertex> vertexes = new ArrayList<NetworkVertex>(); for (TokenI token:company.getTokens()){ diff --git a/rails/algorithms/NetworkIterator.java b/rails/algorithms/NetworkIterator.java index f4029e8..1adc0a6 100644 --- a/rails/algorithms/NetworkIterator.java +++ b/rails/algorithms/NetworkIterator.java @@ -26,6 +26,7 @@ private NetworkVertex startVertex; private boolean startVertexVisited; private boolean routeIterator; + private boolean ignoreSinks; // internal data private List<NetworkVertex> stack = new ArrayList<NetworkVertex>(); @@ -41,14 +42,14 @@ public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, NetworkVertex startVertex) { - this(graph, startVertex, null); + this(graph, startVertex, null, false); } /** * Returns NetworkIterator for specific company */ public NetworkIterator(Graph<NetworkVertex, NetworkEdge> graph, NetworkVertex startVertex, - PublicCompanyI company) { + PublicCompanyI company, boolean ignoreSinks) { super(); if (graph == null) @@ -61,6 +62,7 @@ this.startVertex = startVertex; this.startVertexVisited = false; this.routeIterator = false; + this.ignoreSinks = ignoreSinks; } NetworkIterator setRouteIterator(boolean routeIterator) { @@ -174,7 +176,7 @@ private void addUnseenChildrenOf(NetworkVertex vertex, boolean greedy) { - if (vertex.isSink()) return; + if (vertex.isSink() && (!ignoreSinks)) return; log.debug("Iterator: Add unseen children of " + vertex); for (NetworkEdge edge : graph.edgesOf(vertex)) { diff --git a/rails/algorithms/NetworkVertex.java b/rails/algorithms/NetworkVertex.java index 91356af..03045b9 100644 --- a/rails/algorithms/NetworkVertex.java +++ b/rails/algorithms/NetworkVertex.java @@ -311,7 +311,7 @@ */ public static void initAllRailsVertices(Graph<NetworkVertex, NetworkEdge> graph, PublicCompanyI company, PhaseI phase) { - + // store vertices for removal List<NetworkVertex> verticesToRemove = new ArrayList<NetworkVertex>(); for (NetworkVertex v:graph.vertexSet()) { On Wed, Aug 28, 2013 at 4:52 PM, Michael Alexander <out...@gm...>wrote: > Here's what I ended up with so far: > > compA is the private investor > compB is the company to check to see if there is a connection with > > PublicCompanyI compA = operatingCompany.get(); > ... > NetworkGraphBuilder nwGraph = > NetworkGraphBuilder.create(gameManager); > NetworkCompanyGraph companyGraph = > NetworkCompanyGraph.create(nwGraph, compA); > SimpleGraph<NetworkVertex, NetworkEdge> graph = > companyGraph.createRouteGraph(true); > Set<NetworkVertex> verticies = graph.vertexSet(); > ... > for (TokenI token : compB.getTokens()) { > TokenHolder holder = token.getHolder(); > if (!(holder instanceof Stop)) continue; > Stop city = (Stop) holder; > Station station = city.getRelatedStation(); > > for (NetworkVertex vert : verticies) { > if (vert.getType() == > NetworkVertex.VertexType.STATION) { > Station vertStation = vert.getStation(); > if (station == vertStation) { > // There is a link between the companies! > Hooray! > } > } > } > } > ... > > This seems to work for simple cases, however, I suspect (without digging > too much) that it will get blocked by tokens, which I can't have. I bet it > won't be too hard to fix, tho. > > Mike > > > > On Wed, Aug 28, 2013 at 2:38 PM, brett lentz <bre...@gm...>wrote: > >> In order to do tile rotations, there is already logic that is aware of >> the "exits" of a tile. There's also the route suggestion code. >> >> It might be possible to leverage that same code to create a route graph >> that enables detection of destination runs. >> >> It probably needs a fair bit of work to adapt for this purpose, but those >> are at least places in the code to start looking. >> >> ---Brett. >> >> >> ---Brett. >> >> >> On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer <chr...@gm...>wrote: >> >>> There are games where tokens do block destinations, so whatever code >>> you write should allow for that possibility. There are also games >>> where connections are considered complete as soon as the tile is laid, >>> and others where the check occurs during the relevant company's >>> operating turn. >>> >>> -- >>> Chris >>> >>> Please consider the environment before printing this e-mail. >>> >>> >>> On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander >>> <out...@gm...> wrote: >>> > Both Major Companies in 1856 and Foreign Investors in 1880 have the >>> idea of >>> > needing to reach a destination. Both are implemented by having the >>> game >>> > player use a special action to tell the game engine that a connection >>> has >>> > taken place. Once the connection exists, some one time event occurs. >>> It >>> > seems like if there is code that could be used to determine if a >>> connection >>> > exists, the game could automatically determine that without relying on >>> the >>> > player to tell it. >>> > >>> > So I actually want something slightly different than what I said. >>> It's not >>> > that the current company can make a run between two hexes that I want >>> to >>> > know, it's that a connection exists (regardless of tokens). >>> > >>> > Mike >>> > >>> > >>> > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer < >>> chr...@gm...> >>> > wrote: >>> >> >>> >> Would this be for games where companies are limited to building track >>> >> where their trains can actually reach, or some other purpose? >>> >> >>> >> -- >>> >> Chris >>> >> >>> >> Please consider the environment before printing this e-mail. >>> >> >>> >> >>> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander >>> >> <out...@gm...> wrote: >>> >> > Everyone, >>> >> > >>> >> > I'd like to add a check to see if the currently operating >>> company >>> >> > can >>> >> > run from specific MapHex to another. It seems like there should be >>> a >>> >> > way to >>> >> > do this, since a similar calculation would have to be made when >>> >> > determining >>> >> > what MapHexs are eligible to have a tile placed, but I can't seem to >>> >> > figure >>> >> > out how to do it. What am I missing? >>> >> > >>> >> > Thanks, >>> >> > >>> >> > Michael Alexander >>> >> > >>> >> > >>> >> > >>> ------------------------------------------------------------------------------ >>> >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >>> more! >>> >> > Discover the easy way to master current and previous Microsoft >>> >> > technologies >>> >> > and advance your career. Get an incredible 1,500+ hours of >>> step-by-step >>> >> > tutorial videos with LearnDevNow. Subscribe today and save! >>> >> > >>> >> > >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> >> > _______________________________________________ >>> >> > Rails-devel mailing list >>> >> > Rai...@li... >>> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>> >> > >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >>> >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>> >> Discover the easy way to master current and previous Microsoft >>> >> technologies >>> >> and advance your career. Get an incredible 1,500+ hours of >>> step-by-step >>> >> tutorial videos with LearnDevNow. Subscribe today and save! >>> >> >>> >> >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> >> _______________________________________________ >>> >> Rails-devel mailing list >>> >> Rai...@li... >>> >> https://lists.sourceforge.net/lists/listinfo/rails-devel >>> > >>> > >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>> > Discover the easy way to master current and previous Microsoft >>> technologies >>> > and advance your career. Get an incredible 1,500+ hours of step-by-step >>> > tutorial videos with LearnDevNow. Subscribe today and save! >>> > >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> > _______________________________________________ >>> > Rails-devel mailing list >>> > Rai...@li... >>> > https://lists.sourceforge.net/lists/listinfo/rails-devel >>> > >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>> Discover the easy way to master current and previous Microsoft >>> technologies >>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>> tutorial videos with LearnDevNow. Subscribe today and save! >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Rails-devel mailing list >>> Rai...@li... >>> https://lists.sourceforge.net/lists/listinfo/rails-devel >>> >> >> >> >> ------------------------------------------------------------------------------ >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> Discover the easy way to master current and previous Microsoft >> technologies >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> tutorial videos with LearnDevNow. Subscribe today and save! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> >> > |
From: Michael A. <out...@gm...> - 2013-08-28 20:52:18
|
Here's what I ended up with so far: compA is the private investor compB is the company to check to see if there is a connection with PublicCompanyI compA = operatingCompany.get(); ... NetworkGraphBuilder nwGraph = NetworkGraphBuilder.create(gameManager); NetworkCompanyGraph companyGraph = NetworkCompanyGraph.create(nwGraph, compA); SimpleGraph<NetworkVertex, NetworkEdge> graph = companyGraph.createRouteGraph(true); Set<NetworkVertex> verticies = graph.vertexSet(); ... for (TokenI token : compB.getTokens()) { TokenHolder holder = token.getHolder(); if (!(holder instanceof Stop)) continue; Stop city = (Stop) holder; Station station = city.getRelatedStation(); for (NetworkVertex vert : verticies) { if (vert.getType() == NetworkVertex.VertexType.STATION) { Station vertStation = vert.getStation(); if (station == vertStation) { // There is a link between the companies! Hooray! } } } } ... This seems to work for simple cases, however, I suspect (without digging too much) that it will get blocked by tokens, which I can't have. I bet it won't be too hard to fix, tho. Mike On Wed, Aug 28, 2013 at 2:38 PM, brett lentz <bre...@gm...> wrote: > In order to do tile rotations, there is already logic that is aware of the > "exits" of a tile. There's also the route suggestion code. > > It might be possible to leverage that same code to create a route graph > that enables detection of destination runs. > > It probably needs a fair bit of work to adapt for this purpose, but those > are at least places in the code to start looking. > > ---Brett. > > > ---Brett. > > > On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer <chr...@gm...>wrote: > >> There are games where tokens do block destinations, so whatever code >> you write should allow for that possibility. There are also games >> where connections are considered complete as soon as the tile is laid, >> and others where the check occurs during the relevant company's >> operating turn. >> >> -- >> Chris >> >> Please consider the environment before printing this e-mail. >> >> >> On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander >> <out...@gm...> wrote: >> > Both Major Companies in 1856 and Foreign Investors in 1880 have the >> idea of >> > needing to reach a destination. Both are implemented by having the game >> > player use a special action to tell the game engine that a connection >> has >> > taken place. Once the connection exists, some one time event occurs. >> It >> > seems like if there is code that could be used to determine if a >> connection >> > exists, the game could automatically determine that without relying on >> the >> > player to tell it. >> > >> > So I actually want something slightly different than what I said. It's >> not >> > that the current company can make a run between two hexes that I want to >> > know, it's that a connection exists (regardless of tokens). >> > >> > Mike >> > >> > >> > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer <chr...@gm... >> > >> > wrote: >> >> >> >> Would this be for games where companies are limited to building track >> >> where their trains can actually reach, or some other purpose? >> >> >> >> -- >> >> Chris >> >> >> >> Please consider the environment before printing this e-mail. >> >> >> >> >> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander >> >> <out...@gm...> wrote: >> >> > Everyone, >> >> > >> >> > I'd like to add a check to see if the currently operating company >> >> > can >> >> > run from specific MapHex to another. It seems like there should be a >> >> > way to >> >> > do this, since a similar calculation would have to be made when >> >> > determining >> >> > what MapHexs are eligible to have a tile placed, but I can't seem to >> >> > figure >> >> > out how to do it. What am I missing? >> >> > >> >> > Thanks, >> >> > >> >> > Michael Alexander >> >> > >> >> > >> >> > >> ------------------------------------------------------------------------------ >> >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, >> more! >> >> > Discover the easy way to master current and previous Microsoft >> >> > technologies >> >> > and advance your career. Get an incredible 1,500+ hours of >> step-by-step >> >> > tutorial videos with LearnDevNow. Subscribe today and save! >> >> > >> >> > >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> >> > _______________________________________________ >> >> > Rails-devel mailing list >> >> > Rai...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> >> > >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> >> Discover the easy way to master current and previous Microsoft >> >> technologies >> >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> >> tutorial videos with LearnDevNow. Subscribe today and save! >> >> >> >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> >> _______________________________________________ >> >> Rails-devel mailing list >> >> Rai...@li... >> >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> > >> > >> > >> ------------------------------------------------------------------------------ >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> > Discover the easy way to master current and previous Microsoft >> technologies >> > and advance your career. Get an incredible 1,500+ hours of step-by-step >> > tutorial videos with LearnDevNow. Subscribe today and save! >> > >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> >> >> ------------------------------------------------------------------------------ >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> Discover the easy way to master current and previous Microsoft >> technologies >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> tutorial videos with LearnDevNow. Subscribe today and save! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: brett l. <bre...@gm...> - 2013-08-28 18:39:13
|
In order to do tile rotations, there is already logic that is aware of the "exits" of a tile. There's also the route suggestion code. It might be possible to leverage that same code to create a route graph that enables detection of destination runs. It probably needs a fair bit of work to adapt for this purpose, but those are at least places in the code to start looking. ---Brett. ---Brett. On Wed, Aug 28, 2013 at 9:50 AM, Chris Shaffer <chr...@gm...>wrote: > There are games where tokens do block destinations, so whatever code > you write should allow for that possibility. There are also games > where connections are considered complete as soon as the tile is laid, > and others where the check occurs during the relevant company's > operating turn. > > -- > Chris > > Please consider the environment before printing this e-mail. > > > On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander > <out...@gm...> wrote: > > Both Major Companies in 1856 and Foreign Investors in 1880 have the idea > of > > needing to reach a destination. Both are implemented by having the game > > player use a special action to tell the game engine that a connection has > > taken place. Once the connection exists, some one time event occurs. It > > seems like if there is code that could be used to determine if a > connection > > exists, the game could automatically determine that without relying on > the > > player to tell it. > > > > So I actually want something slightly different than what I said. It's > not > > that the current company can make a run between two hexes that I want to > > know, it's that a connection exists (regardless of tokens). > > > > Mike > > > > > > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer <chr...@gm...> > > wrote: > >> > >> Would this be for games where companies are limited to building track > >> where their trains can actually reach, or some other purpose? > >> > >> -- > >> Chris > >> > >> Please consider the environment before printing this e-mail. > >> > >> > >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander > >> <out...@gm...> wrote: > >> > Everyone, > >> > > >> > I'd like to add a check to see if the currently operating company > >> > can > >> > run from specific MapHex to another. It seems like there should be a > >> > way to > >> > do this, since a similar calculation would have to be made when > >> > determining > >> > what MapHexs are eligible to have a tile placed, but I can't seem to > >> > figure > >> > out how to do it. What am I missing? > >> > > >> > Thanks, > >> > > >> > Michael Alexander > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > >> > Discover the easy way to master current and previous Microsoft > >> > technologies > >> > and advance your career. Get an incredible 1,500+ hours of > step-by-step > >> > tutorial videos with LearnDevNow. Subscribe today and save! > >> > > >> > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > >> > _______________________________________________ > >> > Rails-devel mailing list > >> > Rai...@li... > >> > https://lists.sourceforge.net/lists/listinfo/rails-devel > >> > > >> > >> > >> > ------------------------------------------------------------------------------ > >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > >> Discover the easy way to master current and previous Microsoft > >> technologies > >> and advance your career. Get an incredible 1,500+ hours of step-by-step > >> tutorial videos with LearnDevNow. Subscribe today and save! > >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > >> _______________________________________________ > >> Rails-devel mailing list > >> Rai...@li... > >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > > Discover the easy way to master current and previous Microsoft > technologies > > and advance your career. Get an incredible 1,500+ hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Chris S. <chr...@gm...> - 2013-08-28 13:50:58
|
There are games where tokens do block destinations, so whatever code you write should allow for that possibility. There are also games where connections are considered complete as soon as the tile is laid, and others where the check occurs during the relevant company's operating turn. -- Chris Please consider the environment before printing this e-mail. On Wed, Aug 28, 2013 at 6:35 AM, Michael Alexander <out...@gm...> wrote: > Both Major Companies in 1856 and Foreign Investors in 1880 have the idea of > needing to reach a destination. Both are implemented by having the game > player use a special action to tell the game engine that a connection has > taken place. Once the connection exists, some one time event occurs. It > seems like if there is code that could be used to determine if a connection > exists, the game could automatically determine that without relying on the > player to tell it. > > So I actually want something slightly different than what I said. It's not > that the current company can make a run between two hexes that I want to > know, it's that a connection exists (regardless of tokens). > > Mike > > > On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer <chr...@gm...> > wrote: >> >> Would this be for games where companies are limited to building track >> where their trains can actually reach, or some other purpose? >> >> -- >> Chris >> >> Please consider the environment before printing this e-mail. >> >> >> On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander >> <out...@gm...> wrote: >> > Everyone, >> > >> > I'd like to add a check to see if the currently operating company >> > can >> > run from specific MapHex to another. It seems like there should be a >> > way to >> > do this, since a similar calculation would have to be made when >> > determining >> > what MapHexs are eligible to have a tile placed, but I can't seem to >> > figure >> > out how to do it. What am I missing? >> > >> > Thanks, >> > >> > Michael Alexander >> > >> > >> > ------------------------------------------------------------------------------ >> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> > Discover the easy way to master current and previous Microsoft >> > technologies >> > and advance your career. Get an incredible 1,500+ hours of step-by-step >> > tutorial videos with LearnDevNow. Subscribe today and save! >> > >> > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > Rails-devel mailing list >> > Rai...@li... >> > https://lists.sourceforge.net/lists/listinfo/rails-devel >> > >> >> >> ------------------------------------------------------------------------------ >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> Discover the easy way to master current and previous Microsoft >> technologies >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> tutorial videos with LearnDevNow. Subscribe today and save! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Michael A. <out...@gm...> - 2013-08-28 13:35:55
|
Both Major Companies in 1856 and Foreign Investors in 1880 have the idea of needing to reach a destination. Both are implemented by having the game player use a special action to tell the game engine that a connection has taken place. Once the connection exists, some one time event occurs. It seems like if there is code that could be used to determine if a connection exists, the game could automatically determine that without relying on the player to tell it. So I actually want something slightly different than what I said. It's not that the current company can make a run between two hexes that I want to know, it's that a connection exists (regardless of tokens). Mike On Wed, Aug 28, 2013 at 9:28 AM, Chris Shaffer <chr...@gm...>wrote: > Would this be for games where companies are limited to building track > where their trains can actually reach, or some other purpose? > > -- > Chris > > Please consider the environment before printing this e-mail. > > > On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander > <out...@gm...> wrote: > > Everyone, > > > > I'd like to add a check to see if the currently operating company can > > run from specific MapHex to another. It seems like there should be a > way to > > do this, since a similar calculation would have to be made when > determining > > what MapHexs are eligible to have a tile placed, but I can't seem to > figure > > out how to do it. What am I missing? > > > > Thanks, > > > > Michael Alexander > > > > > ------------------------------------------------------------------------------ > > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > > Discover the easy way to master current and previous Microsoft > technologies > > and advance your career. Get an incredible 1,500+ hours of step-by-step > > tutorial videos with LearnDevNow. Subscribe today and save! > > > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Chris S. <chr...@gm...> - 2013-08-28 13:28:20
|
Would this be for games where companies are limited to building track where their trains can actually reach, or some other purpose? -- Chris Please consider the environment before printing this e-mail. On Tue, Aug 27, 2013 at 11:24 PM, Michael Alexander <out...@gm...> wrote: > Everyone, > > I'd like to add a check to see if the currently operating company can > run from specific MapHex to another. It seems like there should be a way to > do this, since a similar calculation would have to be made when determining > what MapHexs are eligible to have a tile placed, but I can't seem to figure > out how to do it. What am I missing? > > Thanks, > > Michael Alexander > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Stefan F. <ste...@we...> - 2013-08-28 10:10:09
|
Hi Michael, I will come back to this question as soon as I have some time to spare. Unfortunately real life events are still keeping me busy. Stefan On 08/28/2013 08:24 AM, Michael Alexander wrote: > Everyone, > > I'd like to add a check to see if the currently operating company > can run from specific MapHex to another. It seems like there should be > a way to do this, since a similar calculation would have to be made when > determining what MapHexs are eligible to have a tile placed, but I can't > seem to figure out how to do it. What am I missing? > > Thanks, > > Michael Alexander > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: Michael A. <out...@gm...> - 2013-08-28 06:24:49
|
Everyone, I'd like to add a check to see if the currently operating company can run from specific MapHex to another. It seems like there should be a way to do this, since a similar calculation would have to be made when determining what MapHexs are eligible to have a tile placed, but I can't seem to figure out how to do it. What am I missing? Thanks, Michael Alexander |
From: Michael A. <out...@gm...> - 2013-08-26 14:59:37
|
Martin had almost all of the logic in place for this - I just had to add in one additional check. On Mon, Aug 26, 2013 at 9:24 AM, Chris Shaffer <chr...@gm...>wrote: > I've seen players open a second company several times, and seen it > taken over once. Even if a share was available, it should not be > assigned to a foreign investor, since the person taking over the > company did not found it. Here's a scenario where that might happen: > > Player 1 launches HKR, FI takes HKR share > Player 1 launches JHA, no FI share taken > Player 2 buys JHA > Player 2 buys JHA > Player 1 seeing the takeover coming sells 2 JHA; player 2 becomes > president and still no FI takes a share even though one is available. > > -- > Chris > > Please consider the environment before printing this e-mail. > > > On Mon, Aug 26, 2013 at 2:10 AM, Dr....@t-... > <Dr....@t-...> wrote: > > Hi Michael, > > > > > > > > the behaviour of the code as currently observed is wrong. According to > the > > rules neither Investor should have a share of the HKR. The Investor of > > Player A holds a BCR share, Player B buys 30% to become director (thus no > > shares are available until the Phase 3). > > > > > > > > And the rules state : > > > > "As soon as the owner of the FI founds his first company (buys the > directors > > certificate), one share of this company is placed on the charter of the > > foreigen investor." > > > > > > > > So the current implementation by myself is flawed :(. > > > > > > > > Your approach to fixing that sounds good, but dont forget to check the > fact > > that each FI gets only one share .) > > > > > > > > Regards, > > > > Martin > > > > > > > > P.s. your changes are already committed so please fetch them first and > apply > > them to your local branch, otherwise i get to many patch mismatches :) > > > > P.P.s. Thanks again ! :) > > > > > > > > > > > > > > Von: Michael Alexander <out...@gm...> > > > > An: "Dr....@t-..." <Dr....@t-...>, > > "Development list for Rails: an 18xx game" > > <rai...@li...> > > > > Betreff: Re: [Rails-devel] Patch to fix private company revenue > > > > Datum: Mon, 26 Aug 2013 08:52:30 +0200 > > > > > > > > > > > > The scenario was this: > > > > Player A bought the IG (getting the BCR). His foreign investor took a > BCR > > share. He then opened the HKR at 20%. Player B (who had not yet opened > a > > company) bought the remaining 30% of HKR that was available and took over > > the company. The code assumed that Player B has opened it, and gave > player > > B's investor a share of HKR. > > > > My approach to fixing it (which I have coded, but isn't in the files I > sent > > because I just did it) was to have the public company keep track of the > > "founder" - which was the player who bought the president's share, and to > > put another check on the Investor to only allow it to take a share if the > > current player was also the founder. > > > > Mike > > > > > > On Mon, Aug 26, 2013 at 2:45 AM, Dr....@t-... > > <Dr....@t-...> wrote: > > > > Hi Michael, > > > > > > > > thanks, i'll incorporate the patches later today. > > > > > > > > Regarding the takeover in the initial round, tht should not be possible, > as > > a player will found/start a company with at least 20 percent, the FI of > the > > player gets another 10, that just leaves 20 percent in the open stock > (till > > the first 3 has been bought). So theres no take over possible in the > initial > > round. Ergo we have a bug in there somewhere. I'll have look later > tonight > > at the save file. > > > > > > > > Regards, > > > > Martin > > > > > > > > Von: Michael Alexander <out...@gm...> > > > > An: "Development list for Rails: an 18xx game" > > <rai...@li...> > > > > Betreff: Re: [Rails-devel] Patch to fix private company revenue > > > > Datum: Mon, 26 Aug 2013 05:33:47 +0200 > > > > > > > > > > > > Martin, > > > > I think these patches fix the problems I saw with price slots. I saw a > few > > things (BCR didn't get a slot, for example, and I had trouble getting > > companies to open at the right prices). I ended up pulling out the > ParSlot > > into it's own class(es). It didn't seem appropriate for it to be part of > > the stock market. If you could take a look at these changes and let me > know > > what you think, I'd appreciate it. > > > > I also included the save game that represents as far as I can get with > this > > version in the online game I'm in before I hit another problem. In the > > initial stock round, one of the players took the presidency of a company > > from another player. The game (we believe incorrectly) then puts a > share of > > that company in the FI. We think because the second player didn't form > the > > company (he just took it over) that it shouldn't do that. > > > > Mike > > > > > > On Sat, Aug 24, 2013 at 5:27 PM, Martin Brumm < > dr....@t-...> > > wrote: > > > > Am 24.08.2013 23:19, schrieb Michael Alexander: > > > > Hi Mike, > > > > i have a preliminary version in the latest 1880_specific committed. > > > > But it still has its flaws. > > Startround uses a different numeration, this is not yet carried over to > the > > main StartCompany procedure. > > The StartCompany_procedure for the priceslot still needs adjustments > also. > > If you want to give it a shot, great. > > > > I have prepared a build for the BGG-Guys to use with those caveats... > > Can be found at > > https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip > > As i dont have access to the release build mechanismn on sourceforge > myself > > :) > > > > Regards, > > Martin > > > > P.s. in the archive of rails-devel theres a lot of nice information > > regarding the intended architecture by Brett, Stefan and Erik. > > > > Martin, > > > > Are you working on the price slots? I was thinking about taking a > look > > at them, but I wouldn't want to step on stuff you've already written. > > > > Mike > > > > > > On Sat, Aug 24, 2013 at 3:36 PM, Martin Brumm < > dr....@t-...> > > wrote: > > > > Hi Michael, > > > > thanks again, i applied the patch to 1880_specific, though i thought i > had > > fixed the behaviour in the code already pushed. > > > > The second fix for StartCompany_1880 needs to be classified into the > > category : "Ouch :)". > > > > Thanks for catching it. > > > > Regards, > > Martin > > > > > > > ------------------------------------------------------------------------------ > > Introducing Performance Central, a new site from SourceForge and > > AppDynamics. Performance Central is your source for news, insights, > > analysis and resources for efficient Application Performance Management. > > Visit us today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Introducing Performance Central, a new site from SourceForge and > > AppDynamics. Performance Central is your source for news, insights, > > analysis and resources for efficient Application Performance Management. > > Visit us today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > > > > > > > ------------------------------------------------------------------------------ > > Introducing Performance Central, a new site from SourceForge and > > AppDynamics. Performance Central is your source for news, insights, > > analysis and resources for efficient Application Performance Management. > > Visit us today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > > _______________________________________________ > > Rails-devel mailing list > > Rai...@li... > > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > |
From: Chris S. <chr...@gm...> - 2013-08-26 13:25:35
|
Also note that a player can decline to open a company in SR1. I once saw a game where a player's first company was founded after the first T4 was purchased. -- Chris Please consider the environment before printing this e-mail. On Mon, Aug 26, 2013 at 6:24 AM, Chris Shaffer <chr...@gm...> wrote: > I've seen players open a second company several times, and seen it > taken over once. Even if a share was available, it should not be > assigned to a foreign investor, since the person taking over the > company did not found it. Here's a scenario where that might happen: > > Player 1 launches HKR, FI takes HKR share > Player 1 launches JHA, no FI share taken > Player 2 buys JHA > Player 2 buys JHA > Player 1 seeing the takeover coming sells 2 JHA; player 2 becomes > president and still no FI takes a share even though one is available. > > -- > Chris > > Please consider the environment before printing this e-mail. > > > On Mon, Aug 26, 2013 at 2:10 AM, Dr....@t-... > <Dr....@t-...> wrote: >> Hi Michael, >> >> >> >> the behaviour of the code as currently observed is wrong. According to the >> rules neither Investor should have a share of the HKR. The Investor of >> Player A holds a BCR share, Player B buys 30% to become director (thus no >> shares are available until the Phase 3). >> >> >> >> And the rules state : >> >> "As soon as the owner of the FI founds his first company (buys the directors >> certificate), one share of this company is placed on the charter of the >> foreigen investor." >> >> >> >> So the current implementation by myself is flawed :(. >> >> >> >> Your approach to fixing that sounds good, but dont forget to check the fact >> that each FI gets only one share .) >> >> >> >> Regards, >> >> Martin >> >> >> >> P.s. your changes are already committed so please fetch them first and apply >> them to your local branch, otherwise i get to many patch mismatches :) >> >> P.P.s. Thanks again ! :) >> >> >> >> >> >> >> Von: Michael Alexander <out...@gm...> >> >> An: "Dr....@t-..." <Dr....@t-...>, >> "Development list for Rails: an 18xx game" >> <rai...@li...> >> >> Betreff: Re: [Rails-devel] Patch to fix private company revenue >> >> Datum: Mon, 26 Aug 2013 08:52:30 +0200 >> >> >> >> >> >> The scenario was this: >> >> Player A bought the IG (getting the BCR). His foreign investor took a BCR >> share. He then opened the HKR at 20%. Player B (who had not yet opened a >> company) bought the remaining 30% of HKR that was available and took over >> the company. The code assumed that Player B has opened it, and gave player >> B's investor a share of HKR. >> >> My approach to fixing it (which I have coded, but isn't in the files I sent >> because I just did it) was to have the public company keep track of the >> "founder" - which was the player who bought the president's share, and to >> put another check on the Investor to only allow it to take a share if the >> current player was also the founder. >> >> Mike >> >> >> On Mon, Aug 26, 2013 at 2:45 AM, Dr....@t-... >> <Dr....@t-...> wrote: >> >> Hi Michael, >> >> >> >> thanks, i'll incorporate the patches later today. >> >> >> >> Regarding the takeover in the initial round, tht should not be possible, as >> a player will found/start a company with at least 20 percent, the FI of the >> player gets another 10, that just leaves 20 percent in the open stock (till >> the first 3 has been bought). So theres no take over possible in the initial >> round. Ergo we have a bug in there somewhere. I'll have look later tonight >> at the save file. >> >> >> >> Regards, >> >> Martin >> >> >> >> Von: Michael Alexander <out...@gm...> >> >> An: "Development list for Rails: an 18xx game" >> <rai...@li...> >> >> Betreff: Re: [Rails-devel] Patch to fix private company revenue >> >> Datum: Mon, 26 Aug 2013 05:33:47 +0200 >> >> >> >> >> >> Martin, >> >> I think these patches fix the problems I saw with price slots. I saw a few >> things (BCR didn't get a slot, for example, and I had trouble getting >> companies to open at the right prices). I ended up pulling out the ParSlot >> into it's own class(es). It didn't seem appropriate for it to be part of >> the stock market. If you could take a look at these changes and let me know >> what you think, I'd appreciate it. >> >> I also included the save game that represents as far as I can get with this >> version in the online game I'm in before I hit another problem. In the >> initial stock round, one of the players took the presidency of a company >> from another player. The game (we believe incorrectly) then puts a share of >> that company in the FI. We think because the second player didn't form the >> company (he just took it over) that it shouldn't do that. >> >> Mike >> >> >> On Sat, Aug 24, 2013 at 5:27 PM, Martin Brumm <dr....@t-...> >> wrote: >> >> Am 24.08.2013 23:19, schrieb Michael Alexander: >> >> Hi Mike, >> >> i have a preliminary version in the latest 1880_specific committed. >> >> But it still has its flaws. >> Startround uses a different numeration, this is not yet carried over to the >> main StartCompany procedure. >> The StartCompany_procedure for the priceslot still needs adjustments also. >> If you want to give it a shot, great. >> >> I have prepared a build for the BGG-Guys to use with those caveats... >> Can be found at >> https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip >> As i dont have access to the release build mechanismn on sourceforge myself >> :) >> >> Regards, >> Martin >> >> P.s. in the archive of rails-devel theres a lot of nice information >> regarding the intended architecture by Brett, Stefan and Erik. >> >> Martin, >> >> Are you working on the price slots? I was thinking about taking a look >> at them, but I wouldn't want to step on stuff you've already written. >> >> Mike >> >> >> On Sat, Aug 24, 2013 at 3:36 PM, Martin Brumm <dr....@t-...> >> wrote: >> >> Hi Michael, >> >> thanks again, i applied the patch to 1880_specific, though i thought i had >> fixed the behaviour in the code already pushed. >> >> The second fix for StartCompany_1880 needs to be classified into the >> category : "Ouch :)". >> >> Thanks for catching it. >> >> Regards, >> Martin >> >> >> ------------------------------------------------------------------------------ >> Introducing Performance Central, a new site from SourceForge and >> AppDynamics. Performance Central is your source for news, insights, >> analysis and resources for efficient Application Performance Management. >> Visit us today! >> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> >> >> >> >> ------------------------------------------------------------------------------ >> Introducing Performance Central, a new site from SourceForge and >> AppDynamics. Performance Central is your source for news, insights, >> analysis and resources for efficient Application Performance Management. >> Visit us today! >> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> >> >> >> >> ------------------------------------------------------------------------------ >> Introducing Performance Central, a new site from SourceForge and >> AppDynamics. Performance Central is your source for news, insights, >> analysis and resources for efficient Application Performance Management. >> Visit us today! >> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> |
From: Chris S. <chr...@gm...> - 2013-08-26 13:24:31
|
I've seen players open a second company several times, and seen it taken over once. Even if a share was available, it should not be assigned to a foreign investor, since the person taking over the company did not found it. Here's a scenario where that might happen: Player 1 launches HKR, FI takes HKR share Player 1 launches JHA, no FI share taken Player 2 buys JHA Player 2 buys JHA Player 1 seeing the takeover coming sells 2 JHA; player 2 becomes president and still no FI takes a share even though one is available. -- Chris Please consider the environment before printing this e-mail. On Mon, Aug 26, 2013 at 2:10 AM, Dr....@t-... <Dr....@t-...> wrote: > Hi Michael, > > > > the behaviour of the code as currently observed is wrong. According to the > rules neither Investor should have a share of the HKR. The Investor of > Player A holds a BCR share, Player B buys 30% to become director (thus no > shares are available until the Phase 3). > > > > And the rules state : > > "As soon as the owner of the FI founds his first company (buys the directors > certificate), one share of this company is placed on the charter of the > foreigen investor." > > > > So the current implementation by myself is flawed :(. > > > > Your approach to fixing that sounds good, but dont forget to check the fact > that each FI gets only one share .) > > > > Regards, > > Martin > > > > P.s. your changes are already committed so please fetch them first and apply > them to your local branch, otherwise i get to many patch mismatches :) > > P.P.s. Thanks again ! :) > > > > > > > Von: Michael Alexander <out...@gm...> > > An: "Dr....@t-..." <Dr....@t-...>, > "Development list for Rails: an 18xx game" > <rai...@li...> > > Betreff: Re: [Rails-devel] Patch to fix private company revenue > > Datum: Mon, 26 Aug 2013 08:52:30 +0200 > > > > > > The scenario was this: > > Player A bought the IG (getting the BCR). His foreign investor took a BCR > share. He then opened the HKR at 20%. Player B (who had not yet opened a > company) bought the remaining 30% of HKR that was available and took over > the company. The code assumed that Player B has opened it, and gave player > B's investor a share of HKR. > > My approach to fixing it (which I have coded, but isn't in the files I sent > because I just did it) was to have the public company keep track of the > "founder" - which was the player who bought the president's share, and to > put another check on the Investor to only allow it to take a share if the > current player was also the founder. > > Mike > > > On Mon, Aug 26, 2013 at 2:45 AM, Dr....@t-... > <Dr....@t-...> wrote: > > Hi Michael, > > > > thanks, i'll incorporate the patches later today. > > > > Regarding the takeover in the initial round, tht should not be possible, as > a player will found/start a company with at least 20 percent, the FI of the > player gets another 10, that just leaves 20 percent in the open stock (till > the first 3 has been bought). So theres no take over possible in the initial > round. Ergo we have a bug in there somewhere. I'll have look later tonight > at the save file. > > > > Regards, > > Martin > > > > Von: Michael Alexander <out...@gm...> > > An: "Development list for Rails: an 18xx game" > <rai...@li...> > > Betreff: Re: [Rails-devel] Patch to fix private company revenue > > Datum: Mon, 26 Aug 2013 05:33:47 +0200 > > > > > > Martin, > > I think these patches fix the problems I saw with price slots. I saw a few > things (BCR didn't get a slot, for example, and I had trouble getting > companies to open at the right prices). I ended up pulling out the ParSlot > into it's own class(es). It didn't seem appropriate for it to be part of > the stock market. If you could take a look at these changes and let me know > what you think, I'd appreciate it. > > I also included the save game that represents as far as I can get with this > version in the online game I'm in before I hit another problem. In the > initial stock round, one of the players took the presidency of a company > from another player. The game (we believe incorrectly) then puts a share of > that company in the FI. We think because the second player didn't form the > company (he just took it over) that it shouldn't do that. > > Mike > > > On Sat, Aug 24, 2013 at 5:27 PM, Martin Brumm <dr....@t-...> > wrote: > > Am 24.08.2013 23:19, schrieb Michael Alexander: > > Hi Mike, > > i have a preliminary version in the latest 1880_specific committed. > > But it still has its flaws. > Startround uses a different numeration, this is not yet carried over to the > main StartCompany procedure. > The StartCompany_procedure for the priceslot still needs adjustments also. > If you want to give it a shot, great. > > I have prepared a build for the BGG-Guys to use with those caveats... > Can be found at > https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip > As i dont have access to the release build mechanismn on sourceforge myself > :) > > Regards, > Martin > > P.s. in the archive of rails-devel theres a lot of nice information > regarding the intended architecture by Brett, Stefan and Erik. > > Martin, > > Are you working on the price slots? I was thinking about taking a look > at them, but I wouldn't want to step on stuff you've already written. > > Mike > > > On Sat, Aug 24, 2013 at 3:36 PM, Martin Brumm <dr....@t-...> > wrote: > > Hi Michael, > > thanks again, i applied the patch to 1880_specific, though i thought i had > fixed the behaviour in the code already pushed. > > The second fix for StartCompany_1880 needs to be classified into the > category : "Ouch :)". > > Thanks for catching it. > > Regards, > Martin > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |
From: <Dr....@t-...> - 2013-08-26 09:10:55
|
Hi Michael, the behaviour of the code as currently observed is wrong. According to the rules neither Investor should have a share of the HKR. The Investor of Player A holds a BCR share, Player B buys 30% to become director (thus no shares are available until the Phase 3). And the rules state : "As soon as the owner of the FI founds his first company (buys the directors certificate), one share of this company is placed on the charter of the foreigen investor." So the current implementation by myself is flawed :(. Your approach to fixing that sounds good, but dont forget to check the fact that each FI gets only one share .) Regards, Martin P.s. your changes are already committed so please fetch them first and apply them to your local branch, otherwise i get to many patch mismatches :) P.P.s. Thanks again ! :) Von: Michael Alexander <out...@gm...> An: "Dr....@t-..." <Dr....@t-...>, "Development list for Rails: an 18xx game" <rai...@li...> Betreff: Re: [Rails-devel] Patch to fix private company revenue Datum: Mon, 26 Aug 2013 08:52:30 +0200 The scenario was this: Player A bought the IG (getting the BCR). His foreign investor took a BCR share. He then opened the HKR at 20%. Player B (who had not yet opened a company) bought the remaining 30% of HKR that was available and took over the company. The code assumed that Player B has opened it, and gave player B's investor a share of HKR. My approach to fixing it (which I have coded, but isn't in the files I sent because I just did it) was to have the public company keep track of the "founder" - which was the player who bought the president's share, and to put another check on the Investor to only allow it to take a share if the current player was also the founder. Mike On Mon, Aug 26, 2013 at 2:45 AM, Dr....@t-... [1] <Dr....@t-... [2]> wrote: Hi Michael, thanks, i'll incorporate the patches later today. Regarding the takeover in the initial round, tht should not be possible, as a player will found/start a company with at least 20 percent, the FI of the player gets another 10, that just leaves 20 percent in the open stock (till the first 3 has been bought). So theres no take over possible in the initial round. Ergo we have a bug in there somewhere. I'll have look later tonight at the save file. Regards, Martin Von: Michael Alexander <out...@gm... [3]> An: "Development list for Rails: an 18xx game" <rai...@li... [4]> Betreff: Re: [Rails-devel] Patch to fix private company revenue Datum: Mon, 26 Aug 2013 05:33:47 +0200 Martin, I think these patches fix the problems I saw with price slots. I saw a few things (BCR didn't get a slot, for example, and I had trouble getting companies to open at the right prices). I ended up pulling out the ParSlot into it's own class(es). It didn't seem appropriate for it to be part of the stock market. If you could take a look at these changes and let me know what you think, I'd appreciate it. I also included the save game that represents as far as I can get with this version in the online game I'm in before I hit another problem. In the initial stock round, one of the players took the presidency of a company from another player. The game (we believe incorrectly) then puts a share of that company in the FI. We think because the second player didn't form the company (he just took it over) that it shouldn't do that. Mike On Sat, Aug 24, 2013 at 5:27 PM, Martin Brumm <dr....@t-... [5]> wrote: Am 24.08.2013 23:19, schrieb Michael Alexander: Hi Mike, i have a preliminary version in the latest 1880_specific committed. But it still has its flaws. Startround uses a different numeration, this is not yet carried over to the main StartCompany procedure. The StartCompany_procedure for the priceslot still needs adjustments also. If you want to give it a shot, great. I have prepared a build for the BGG-Guys to use with those caveats... Can be found at https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip [6] As i dont have access to the release build mechanismn on sourceforge myself :) Regards, Martin P.s. in the archive of rails-devel theres a lot of nice information regarding the intended architecture by Brett, Stefan and Erik. Martin, Are you working on the price slots? I was thinking about taking a look at them, but I wouldn't want to step on stuff you've already written. Mike On Sat, Aug 24, 2013 at 3:36 PM, Martin Brumm <dr....@t-... [7]> wrote: Hi Michael, thanks again, i applied the patch to 1880_specific, though i thought i had fixed the behaviour in the code already pushed. The second fix for StartCompany_1880 needs to be classified into the category : "Ouch :)". Thanks for catching it. Regards, Martin ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk [8] _______________________________________________ Rails-devel mailing list Rai...@li... [9] https://lists.sourceforge.net/lists/listinfo/rails-devel [10] ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk [11] _______________________________________________ Rails-devel mailing list Rai...@li... [12] https://lists.sourceforge.net/lists/listinfo/rails-devel [13] Links: ------ [1] mailto:Dr....@t-... [2] mailto:Dr....@t-... [3] mailto:out...@gm... [4] mailto:rai...@li... [5] mailto:dr....@t-... [6] https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip [7] mailto:dr....@t-... [8] http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk [9] mailto:Rai...@li... [10] https://lists.sourceforge.net/lists/listinfo/rails-devel [11] http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk [12] mailto:Rai...@li... [13] https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Michael A. <out...@gm...> - 2013-08-26 06:52:39
|
The scenario was this: Player A bought the IG (getting the BCR). His foreign investor took a BCR share. He then opened the HKR at 20%. Player B (who had not yet opened a company) bought the remaining 30% of HKR that was available and took over the company. The code assumed that Player B has opened it, and gave player B's investor a share of HKR. My approach to fixing it (which I have coded, but isn't in the files I sent because I just did it) was to have the public company keep track of the "founder" - which was the player who bought the president's share, and to put another check on the Investor to only allow it to take a share if the current player was also the founder. Mike On Mon, Aug 26, 2013 at 2:45 AM, Dr....@t-... < Dr....@t-...> wrote: > Hi Michael, > > > > thanks, i'll incorporate the patches later today. > > > > Regarding the takeover in the initial round, tht should not be possible, > as a player will found/start a company with at least 20 percent, the FI of > the player gets another 10, that just leaves 20 percent in the open stock > (till the first 3 has been bought). So theres no take over possible in the > initial round. Ergo we have a bug in there somewhere. I'll have look later > tonight at the save file. > > > > Regards, > > Martin > > > > *Von:* Michael Alexander <out...@gm...> > > *An:* "Development list for Rails: an 18xx game" < > rai...@li...> > > *Betreff:* Re: [Rails-devel] Patch to fix private company revenue > > *Datum:* Mon, 26 Aug 2013 05:33:47 +0200 > > > > > Martin, > > I think these patches fix the problems I saw with price slots. I saw a > few things (BCR didn't get a slot, for example, and I had trouble getting > companies to open at the right prices). I ended up pulling out the ParSlot > into it's own class(es). It didn't seem appropriate for it to be part of > the stock market. If you could take a look at these changes and let me > know what you think, I'd appreciate it. > > I also included the save game that represents as far as I can get with > this version in the online game I'm in before I hit another problem. In > the initial stock round, one of the players took the presidency of a > company from another player. The game (we believe incorrectly) then puts a > share of that company in the FI. We think because the second player didn't > form the company (he just took it over) that it shouldn't do that. > > Mike > > > On Sat, Aug 24, 2013 at 5:27 PM, Martin Brumm <dr....@t-... > > wrote: > > Am 24.08.2013 23:19, schrieb Michael Alexander: > > Hi Mike, > > i have a preliminary version in the latest 1880_specific committed. > > But it still has its flaws. > Startround uses a different numeration, this is not yet carried over to > the main StartCompany procedure. > The StartCompany_procedure for the priceslot still needs adjustments also. > If you want to give it a shot, great. > > I have prepared a build for the BGG-Guys to use with those caveats... > Can be found at > https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip > As i dont have access to the release build mechanismn on sourceforge > myself :) > > Regards, > Martin > > P.s. in the archive of rails-devel theres a lot of nice information > regarding the intended architecture by Brett, Stefan and Erik. > > Martin, > > Are you working on the price slots? I was thinking about taking a > look at them, but I wouldn't want to step on stuff you've already written. > > Mike > > > On Sat, Aug 24, 2013 at 3:36 PM, Martin Brumm <dr....@t-... > > wrote: > > Hi Michael, > > thanks again, i applied the patch to 1880_specific, though i thought i > had fixed the behaviour in the code already pushed. > > The second fix for StartCompany_1880 needs to be classified into the > category : "Ouch :)". > > Thanks for catching it. > > Regards, > Martin > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > |
From: <Dr....@t-...> - 2013-08-26 06:45:36
|
Hi Michael, thanks, i'll incorporate the patches later today. Regarding the takeover in the initial round, tht should not be possible, as a player will found/start a company with at least 20 percent, the FI of the player gets another 10, that just leaves 20 percent in the open stock (till the first 3 has been bought). So theres no take over possible in the initial round. Ergo we have a bug in there somewhere. I'll have look later tonight at the save file. Regards, Martin Von: Michael Alexander <out...@gm...> An: "Development list for Rails: an 18xx game" <rai...@li...> Betreff: Re: [Rails-devel] Patch to fix private company revenue Datum: Mon, 26 Aug 2013 05:33:47 +0200 Martin, I think these patches fix the problems I saw with price slots. I saw a few things (BCR didn't get a slot, for example, and I had trouble getting companies to open at the right prices). I ended up pulling out the ParSlot into it's own class(es). It didn't seem appropriate for it to be part of the stock market. If you could take a look at these changes and let me know what you think, I'd appreciate it. I also included the save game that represents as far as I can get with this version in the online game I'm in before I hit another problem. In the initial stock round, one of the players took the presidency of a company from another player. The game (we believe incorrectly) then puts a share of that company in the FI. We think because the second player didn't form the company (he just took it over) that it shouldn't do that. Mike On Sat, Aug 24, 2013 at 5:27 PM, Martin Brumm <dr....@t-... [1]> wrote: Am 24.08.2013 23:19, schrieb Michael Alexander: Hi Mike, i have a preliminary version in the latest 1880_specific committed. But it still has its flaws. Startround uses a different numeration, this is not yet carried over to the main StartCompany procedure. The StartCompany_procedure for the priceslot still needs adjustments also. If you want to give it a shot, great. I have prepared a build for the BGG-Guys to use with those caveats... Can be found at https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip [2] As i dont have access to the release build mechanismn on sourceforge myself :) Regards, Martin P.s. in the archive of rails-devel theres a lot of nice information regarding the intended architecture by Brett, Stefan and Erik. Martin, Are you working on the price slots? I was thinking about taking a look at them, but I wouldn't want to step on stuff you've already written. Mike On Sat, Aug 24, 2013 at 3:36 PM, Martin Brumm <dr....@t-... [3]> wrote: Hi Michael, thanks again, i applied the patch to 1880_specific, though i thought i had fixed the behaviour in the code already pushed. The second fix for StartCompany_1880 needs to be classified into the category : "Ouch :)". Thanks for catching it. Regards, Martin ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk [4] _______________________________________________ Rails-devel mailing list Rai...@li... [5] https://lists.sourceforge.net/lists/listinfo/rails-devel [6] Links: ------ [1] mailto:dr....@t-... [2] https://dl.dropboxusercontent.com/u/29072620/rails-1.7.12_1880.zip [3] mailto:dr....@t-... [4] http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk [5] mailto:Rai...@li... [6] https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Michael A. <out...@gm...> - 2013-08-26 03:33:56
|
diff --git a/rails/game/specific/_1880/BuyStartItem_1880.java b/rails/game/specific/_1880/BuyStartItem_1880.java index b97d733..5036509 100644 --- a/rails/game/specific/_1880/BuyStartItem_1880.java +++ b/rails/game/specific/_1880/BuyStartItem_1880.java @@ -21,6 +21,8 @@ private BitSet buildingRights; private BitSet associatedBuildingRight; + + private int parSlotIndex = 0; /** * @param startItem * @param price @@ -167,5 +169,14 @@ } return "None"; } + + + public void setParSlotIndex(int index) { + parSlotIndex = index; + } + + public int getParSlotIndex() { + return parSlotIndex; + } } \ No newline at end of file diff --git a/rails/game/specific/_1880/GameManager_1880.java b/rails/game/specific/_1880/GameManager_1880.java index a8c5f37..c3ed260 100644 --- a/rails/game/specific/_1880/GameManager_1880.java +++ b/rails/game/specific/_1880/GameManager_1880.java @@ -31,6 +31,7 @@ public IntegerState numOfORs = new IntegerState("numOfORs"); //Keeps track of the company that purchased the last train private PublicCompany_1880 lastTrainBuyingCompany; + private ParSlots_1880 parSlots = new ParSlots_1880(); /** * */ @@ -142,5 +143,9 @@ super.finishShareSellingRound(); } + + public ParSlots_1880 getParSlots() { + return parSlots; + } } diff --git a/rails/game/specific/_1880/OperatingRound_1880.java b/rails/game/specific/_1880/OperatingRound_1880.java index f573a95..df1cb8f 100644 --- a/rails/game/specific/_1880/OperatingRound_1880.java +++ b/rails/game/specific/_1880/OperatingRound_1880.java @@ -509,30 +509,25 @@ @Override public List<PublicCompanyI> setOperatingCompanies() { Map<Integer, PublicCompanyI> operatingCompanies = new TreeMap<Integer, PublicCompanyI>(); - int space = 100; - int key; - int minorNo = 0; + int key = 1; + + // Put in Foreign Investors first for (PublicCompanyI company : companyManager.getAllPublicCompanies()) { if (!canCompanyOperateThisRound(company)) continue; - if (! company.hasFloated()) continue; - // Key must put companies in reverse operating order, because sort - // is ascending. - if (company.hasStockPrice()) { - space = company.getStartSpace().getPrice(); - //Corps operate in descending Startprice - //Corps with the same Start price operate in the order they were floated - //Start price will inherently be in the right order - //subtracting the formation order index will put it at the right point to operate - //This wouldn't work if there are lots of corps at the same price - //there are not too many corps in each banding for this to be an issue in 1825 even with all 3 units - key = 1000000 - (space - ((PublicCompany_1880) company).getOperationSlotIndex()); - operatingCompanies.put(new Integer(key), company); - } - else { - key = 50 + ++minorNo; - operatingCompanies.put(new Integer(key), company); + if (!company.hasFloated()) continue; + if (!company.hasStockPrice()) { + operatingCompanies.put(new Integer(key++), company); } } + + // Now the share companies in par slot order + List<PublicCompanyI> companies = ((GameManager_1880) gameManager).getParSlots().getCompaniesInOperatingOrder(); + for (PublicCompanyI company : companies) { + if (!canCompanyOperateThisRound(company)) continue; + if (!company.hasFloated()) continue; + operatingCompanies.put(new Integer(key++), company); + } + return new ArrayList<PublicCompanyI>(operatingCompanies.values()); } diff --git a/rails/game/specific/_1880/ParSlot_1880.java b/rails/game/specific/_1880/ParSlot_1880.java new file mode 100644 index 0000000..6678235 --- /dev/null +++ b/rails/game/specific/_1880/ParSlot_1880.java @@ -0,0 +1,35 @@ +package rails.game.specific._1880; + +/** + * @author Michael Alexander + * + */ +import rails.game.PublicCompanyI; + +public class ParSlot_1880 { + private int index = -1; + private int price = -1; + private PublicCompanyI company = null; + + public ParSlot_1880(int index, int price) { + this.index = index; + this.price = price; + } + + public void setCompany(PublicCompanyI company) { + this.company = company; + } + + public int getIndex() { + return index; + } + + public int getPrice() { + return price; + } + + public PublicCompanyI getCompany() { + return company; + } + +} diff --git a/rails/game/specific/_1880/ParSlots_1880.java b/rails/game/specific/_1880/ParSlots_1880.java new file mode 100644 index 0000000..a7d54b4 --- /dev/null +++ b/rails/game/specific/_1880/ParSlots_1880.java @@ -0,0 +1,62 @@ +package rails.game.specific._1880; + +/** + * @author Michael Alexander + * + */ + +import java.util.ArrayList; +import java.util.List; + +import rails.game.PublicCompanyI; + +public class ParSlots_1880 { + + private List<ParSlot_1880> parSlots = new ArrayList<ParSlot_1880>(); + + public ParSlots_1880() { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + parSlots.add(new ParSlot_1880(i*4+j, 100-(10*i))); + } + } + } + + public List<ParSlot_1880> getEmptyParSlotsAtPrice(int price) { + List<ParSlot_1880> emptySlots = new ArrayList<ParSlot_1880>(); + for (ParSlot_1880 slot : parSlots) { + if ((slot.getCompany() == null) && (slot.getPrice() == price)) { + emptySlots.add(slot); + } + } + return emptySlots; + } + + public boolean freeSlotAtPrice(int price) { + for (ParSlot_1880 slot : parSlots) { + if ((slot.getCompany() == null) && (slot.getPrice() == price)) { + return true; + } + } + return false; + } + + public void setCompanyAtSlot(PublicCompanyI company, int index) { + for (ParSlot_1880 slot : parSlots) { + if (slot.getIndex() == index) { + slot.setCompany(company); + break; + } + } + } + + public List<PublicCompanyI> getCompaniesInOperatingOrder() { + List<PublicCompanyI> companies = new ArrayList<PublicCompanyI>(); + for (ParSlot_1880 slot : parSlots) { + if (slot.getCompany() != null) { + companies.add(slot.getCompany()); + } + } + return companies; + } +} diff --git a/rails/game/specific/_1880/PublicCompany_1880.java b/rails/game/specific/_1880/PublicCompany_1880.java index 0a85c62..da09f38 100644 --- a/rails/game/specific/_1880/PublicCompany_1880.java +++ b/rails/game/specific/_1880/PublicCompany_1880.java @@ -65,7 +65,6 @@ protected IntegerState operationSlotIndex = new IntegerState ("OperatingSlot, 0"); - /** * */ @@ -378,18 +377,5 @@ } } */ - /** - * @return the operationSlotIndex - */ - public int getOperationSlotIndex() { - return operationSlotIndex.intValue(); - } - - /** - * @param operationSlotIndex the operationSlotIndex to set - */ - public void setOperationSlotIndex(int operationSlotIndex) { - this.operationSlotIndex.add(operationSlotIndex); - } } diff --git a/rails/game/specific/_1880/StartCompany_1880.java b/rails/game/specific/_1880/StartCompany_1880.java index 7e02cc6..073d399 100644 --- a/rails/game/specific/_1880/StartCompany_1880.java +++ b/rails/game/specific/_1880/StartCompany_1880.java @@ -6,12 +6,12 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.util.ArrayList; +import java.util.Arrays; import java.util.BitSet; +import java.util.Collections; import java.util.List; -import rails.game.CompanyManagerI; import rails.game.PublicCompanyI; -import rails.game.StockSpace; import rails.game.StockSpaceI; import rails.game.action.StartCompany; @@ -121,9 +121,9 @@ // TODO Auto-generated method stub // make sure that all exhausted price Slots will not be returned as valid prices anymore... startPrices2 = super.getStartPrices(); - for (int e =0 ; e< 4 ; e++) - { - if ( ((StockMarket_1880) gameManager.getStockMarket()).getParSlot(startPrices2[e])== true) //free slot found + for (int e = 0 ; e < startPrices2.length ; e++) + { + if (((GameManager_1880) gameManager).getParSlots().freeSlotAtPrice(startPrices2[e])) //free slot found { startPrices_new.add(startPrices2[e]); } @@ -133,6 +133,26 @@ startPrices2_new[i] = startPrices_new.get(i).intValue(); return startPrices2_new; } + + public List<ParSlot_1880> getStartParSlots() { + List<ParSlot_1880> startParSlots = new ArrayList<ParSlot_1880>(); + int []startPrices = super.getStartPrices(); + Integer []startPrices2 = new Integer[startPrices.length]; + ParSlots_1880 parSlots = ((GameManager_1880) gameManager).getParSlots(); + + for (int i = 0; i < startPrices.length ; i++) { + startPrices2[i] = startPrices[i]; + } + Arrays.sort(startPrices2, Collections.reverseOrder()); + + for (int i = 0; i < startPrices2.length ; i++) { + List<ParSlot_1880> emptySlotsAtThisPrice = parSlots.getEmptyParSlotsAtPrice(startPrices2[i]); + for (ParSlot_1880 slot : emptySlotsAtThisPrice) { + startParSlots.add(slot); + } + } + return startParSlots; + } /* (non-Javadoc) * @see rails.game.action.StartCompany#setStartPrice(int) @@ -140,7 +160,6 @@ public void setStartPrice(int startPrice, int index) { StockSpaceI parPrice=gameManager.getStockMarket().getStartSpace(startPrice); this.getCompany().setParSpace(parPrice); - ((StockMarket_1880) gameManager.getStockMarket()).setParSlot(index); } /** Deserialize */ @@ -191,8 +210,7 @@ return "None"; } - public void setOperatingSlot(int index) { - ((PublicCompany_1880) this.getCompany()).setOperationSlotIndex(index); - + public void setParSlotIndex(int index) { + ((GameManager_1880) gameManager).getParSlots().setCompanyAtSlot(this.getCompany(), index); } } diff --git a/rails/game/specific/_1880/StartRound_1880.java b/rails/game/specific/_1880/StartRound_1880.java index 69d5fd5..39055e9 100644 --- a/rails/game/specific/_1880/StartRound_1880.java +++ b/rails/game/specific/_1880/StartRound_1880.java @@ -4,6 +4,8 @@ package rails.game.specific._1880; import java.util.BitSet; +import java.util.List; +import java.util.Vector; import rails.common.DisplayBuffer; import rails.common.LocalText; @@ -41,6 +43,8 @@ /** A company in need for a par price. */ PublicCompanyI companyNeedingPrice = null; + + private final List<Player> playersPassed = new Vector<Player>(); /** @@ -83,6 +87,7 @@ if (currentItem == null || currentItem.get() != item ) { // we haven't seen this item before numPasses.set(0); // new round so cancel all previous passes ! playersActed.set(0); + playersPassed.clear(); currentItem.set(item); item.setStatus(StartItem.BIDDABLE); item.setStatus(StartItem.BUYABLE); @@ -138,6 +143,7 @@ // Can't bid: Autopass numPasses.add(1); playersActed.add(1); + playersPassed.add(currentPlayer); return false; } } else { // Item is not a private ! should be a major or minor in 1880 special rules apply. @@ -262,6 +268,7 @@ auctionItemState.set(null); numPasses.set(0); playersActed.set(0); + playersPassed.clear(); setNextStartingPlayer(); return true; } else { @@ -303,6 +310,7 @@ numPasses.add(1); playersActed.add(1); + playersPassed.add(player); if (numPasses.intValue() >= numPlayers) { // All players have passed. @@ -318,6 +326,7 @@ Bank.format(startPacket.getFirstItem().getBasePrice()) )); numPasses.set(0); playersActed.set(0); + playersPassed.clear(); if (auctionItem.getBasePrice() == 0) { assignItem((Player)startingPlayer.get(), auctionItem, 0, 0); @@ -327,6 +336,7 @@ } else { numPasses.set(0); playersActed.set(0); + playersPassed.clear(); finishRound(); } @@ -346,6 +356,7 @@ auctionItemState.set(null); numPasses.set(0); playersActed.set(0); + playersPassed.clear(); setNextStartingPlayer(); return true; } else { @@ -371,26 +382,11 @@ } private void setNextBiddingPlayer(StartItem item, int currentIndex) { - boolean bidState = false; for (int i = currentIndex + 1; i < currentIndex + gameManager.getNumberOfPlayers(); i++) { - /* - * Ok we need to make sure that every one has at least the chance to bid once. - * We need to make sure that everyone that has passed cant bid again. - * Unfortunately getBid() or hasBid() return 0 so they cant be of use here until the second bidding round ! - * Now we only need a status indicator how many people have acted already.... - */ - if (playersActed.intValue() == numPlayers) { - bidState = item.hasBid(gameManager.getPlayerByIndex(i)); - if (bidState == true) { - setCurrentPlayerIndex(i); - break; - } else { - continue; - } - } else { - setCurrentPlayerIndex(i); - break; + if (playersPassed.contains(gameManager.getPlayerByIndex(i)) == false) { + setCurrentPlayerIndex(i); + break; } } } @@ -479,6 +475,7 @@ int sharePrice = 0; String shareCompName = ""; BitSet buildingRights = new BitSet(5); + int parSlotIndex = 0; BuyStartItem_1880 boughtItem_1880 = (BuyStartItem_1880) boughtItem; while (true) { @@ -503,6 +500,7 @@ shareCompName = boughtItem_1880.getCompanyToSetPriceFor(); sharePrice = boughtItem_1880.getAssociatedSharePrice(); buildingRights = boughtItem_1880.getAssociatedBuildingRight(); + parSlotIndex = boughtItem_1880.getParSlotIndex(); if (sharePrice == 0) { errMsg = @@ -522,6 +520,7 @@ shareCompName ); break; } + // TODO: Add check for ParSlot validity } break; } @@ -536,14 +535,22 @@ moveStack.start(false); - assignItem(player, item, price, sharePrice, buildingRights); + assignItem(player, item, price, sharePrice, buildingRights, parSlotIndex); // Set priority (only if the item was not auctioned) // ASSUMPTION: getting an item in auction mode never changes priority if (lastBid == 0) { gameManager.setPriorityPlayer(); } - setNextPlayer(); + + // If this item is the "IG" (BCR), then we are still in the "auction" portion + // of the stock round, and the next player is based on the current player + // (not the current player). + if (item == StartItem.getByName("IG")) { + setCurrentPlayerIndex(((Player) startingPlayer.get()).getIndex()); + } else { + setNextPlayer(); + } auctionItemState.set(null); numPasses.set(0); @@ -559,7 +566,7 @@ * @param buildingRights */ private void assignItem(Player player, StartItem item, int price, - int sharePrice, BitSet buildingRights) { + int sharePrice, BitSet buildingRights, int parSlotIndex) { Certificate primary = item.getPrimary(); ReportBuffer.add(LocalText.getText("BuysItemFor", player.getName(), @@ -567,14 +574,14 @@ Bank.format(price) )); pay (player, bank, price); transferCertificate (primary, player.getPortfolio()); - checksOnBuying(primary, sharePrice, buildingRights); + checksOnBuying(primary, sharePrice, buildingRights, parSlotIndex); if (item.hasSecondary()) { Certificate extra = item.getSecondary(); ReportBuffer.add(LocalText.getText("ALSO_GETS", player.getName(), extra.getName() )); transferCertificate (extra, player.getPortfolio()); - checksOnBuying(extra, sharePrice, buildingRights); + checksOnBuying(extra, sharePrice, buildingRights, parSlotIndex); } item.setSold(player, price); @@ -585,7 +592,7 @@ * @param buildingRights */ private void checksOnBuying(Certificate cert, int sharePrice, - BitSet buildingRights) { + BitSet buildingRights, int parSlot) { if (cert instanceof PublicCertificateI) { PublicCertificateI pubCert = (PublicCertificateI) cert; PublicCompany_1880 comp = (PublicCompany_1880) pubCert.getCompany(); @@ -600,6 +607,7 @@ comp.start(sharePrice); //Building Rights are also set.. comp.setBuildingRights(buildingRights); + ((GameManager_1880) gameManager).getParSlots().setCompanyAtSlot(comp, parSlot); comp.setRight("BuildingRight",buildingRightToString(buildingRights)); } else { log.error("No start price for " + comp.getName()); diff --git a/rails/game/specific/_1880/StockMarket_1880.java b/rails/game/specific/_1880/StockMarket_1880.java index 91a2304..5a311c1 100644 --- a/rails/game/specific/_1880/StockMarket_1880.java +++ b/rails/game/specific/_1880/StockMarket_1880.java @@ -29,11 +29,7 @@ public IntegerState parPlace_80; public IntegerState parPlace_70; - - protected int parSlots[]= new int [16]; - - private int freeParSlots [] = new int [16]; - + GameManagerI gameManager; /** @@ -171,115 +167,5 @@ comp.getStartSpace().addFixedStartPrice(comp); } } - } - - /** - * @return all free parSlots - */ - public int[] getParSlots() { - - int i = 0; - for (int e: parSlots ) - { - if (parSlots[e] == 0) - { - freeParSlots[i] = e+1; - i++; - } - } - return freeParSlots; - } - - public int [] getParSlots(int price){ - int [] freeParSlotsPerPrice= new int [4]; - int i =0; - switch (price) { - case 70: - for (int e=0 ; e< 4; e++ ) - { - if ( parSlots[e] == 0) - freeParSlotsPerPrice[e] =e+1; - } - - break; - case 80: - for (int e=4 ; e< 8; e++ ) - { - if ( parSlots[e] == 0) { - i = e % 4; - freeParSlotsPerPrice[i] =e+1; - } - } - break; - case 90: - for (int e=8 ; e< 12; e++ ) - { - if ( parSlots[e] == 0) - { - i = e % 4; - freeParSlotsPerPrice[i] =e+1; - } - } - break; - case 100: - for (int e=12 ; e< 16; e++ ) - { - if ( parSlots[e] == 0){ - i = e % 4; - freeParSlotsPerPrice[i] =e+1; - } - } - default: - return freeParSlotsPerPrice; - } - return freeParSlotsPerPrice; - } - /** - * @param parSlots the parSlots to set - */ - public void setParSlots(int[] parSlots) { - this.parSlots = parSlots; - } - - public boolean setParSlot(int position) { - - if (this.parSlots[position] > 0) { - return false; - } else { - this.parSlots[position] = 1; - return true; - } - } - - public boolean getParSlot(int price) { - switch (price) { - case 70: - for (int e=0 ; e< 4; e++ ) - if ( parSlots[e] == 0) - return true; - break; - case 80: - for (int e=4 ; e< 8; e++ ) - if ( parSlots[e] == 0) - return true; - break; - case 90: - for (int e=8 ; e< 12; e++ ) - if ( parSlots[e] == 0) - return true; - break; - case 100: - for (int e=12 ; e< 16; e++ ) - if ( parSlots[e] == 0) - return true; - break; - default: - return false; - } - return false; - } - - public boolean getParSlot(int price, int position) { - return true; } } diff --git a/rails/game/specific/_1880/StockRound_1880.java b/rails/game/specific/_1880/StockRound_1880.java index 8ed6669..be75bd4 100644 --- a/rails/game/specific/_1880/StockRound_1880.java +++ b/rails/game/specific/_1880/StockRound_1880.java @@ -274,7 +274,7 @@ } else if (!comp.hasStarted()) { List<Integer> startPrices = new ArrayList<Integer>(); for (int startPrice : stockMarket.getStartPrices()) { - if ((startPrice * shares <= playerCash) && (((StockMarket_1880) gameManager.getStockMarket()).getParSlot(startPrice))) { + if ((startPrice * shares <= playerCash) && (((GameManager_1880) gameManager).getParSlots().freeSlotAtPrice(startPrice))) { startPrices.add(startPrice); } } |
From: Chris S. <chr...@gm...> - 2013-08-25 17:44:59
|
Works for me now, thanks. -- Chris Please consider the environment before printing this e-mail. On Sun, Aug 25, 2013 at 8:21 AM, brett lentz <bre...@gm...> wrote: > Yep. Sourceforge rolled out a totally new managemenet UI. I think I've now > got the permissions set right. Please validate and let me know if I need to > poke it more. > > ---Brett. > > > ---Brett. > > > On Sun, Aug 25, 2013 at 11:07 AM, Martin Brumm <dr....@t-...> > wrote: >> >> Hi Chris, >> >> i cant post anything either or even access a ticket. Either sourceforge >> screwed up, or permissions in the project need to be managed anew. >> >> Brett ? Stefan ? Erik ? >> >> Can you have a look at the sourceforge Project Administration for rails ? >> >> Thank you. >> >> Martin >> >> Am 25.08.2013 16:43, schrieb Chris Shaffer: >> > SourceForge seems to have changed their interface. I'm logged in and >> > looking at the bug tickets, but I can't find a button or tool to >> > submit a new bug. Is there a permissions problem or is it a user >> > error? >> > >> > -- >> > Chris >> > >> > >> >> >> >> ------------------------------------------------------------------------------ >> Introducing Performance Central, a new site from SourceForge and >> AppDynamics. Performance Central is your source for news, insights, >> analysis and resources for efficient Application Performance Management. >> Visit us today! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel >> > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |