From: Stefan F. <ste...@we...> - 2014-09-10 19:31:24
|
Brett, Martin and Erik: you all make good points. I do not claim that it IS a hexagonal market and it IS NOT a rectangular or anything else. I only wanted to point out, that treating it as hexagonal is a good representation and potentially a better one as the alternatives. A sketch easily shows the equivalence of mine interpretation to that of Brett below: /-\ /-\ /-\ /-\ /-\ | 1 | 3 | 5 | 7 | 9 \-/ \-/ \-/ \-/-\-/ | 2 | 4 | 6 | 8 | \-/ \-/ \-/ \-/ Actually any hexagonal grid is equivalent to a rectangular one with a half square offset: There are six directions from each square (two each at the top and bottom, one each left and right) and this is equivalent to a hexagon grid. And as Martin already pointed out by using adapted movements it can also be modelled as rectangular grid without any offset. My mere intention was to point out that the stockmarket of 1860/1862 is very similar to the one of 1837/1854 and thus could be treated at a variation of an hexagonal market. Even the movement directions of 1860/1862 are identical to those of 1837/1854 (selling shares movement to lower left, dividend payments to the right). How the UI displays the market in the end is a completely different matter. Stefan On 09/10/2014 05:48 PM, brett lentz wrote: > Stefan - > > Your description is not entirely accurate. > > The market in 1862 is quasi-linear, not hexagonal. It is two rows of > values with a half-value offset between the rows. > > For example: > > +------------------------+ > | 1 | 3 | 5 | 7 | 9 | | | > |-------------------------| > | | 2 | 4 | 6 | 8 | 10 | > +------------------------+ > > Stock values start on the top row. In this example, let's say a > company's par value is at 3. > > When dividends are paid, the value goes "forward" to 5. The value stays > in the same row. > When revenue is withheld, the value goes "backward" to 1. The value > stays in the same row. > > When shares are sold during the stock round, the value moves in a > "zig-zag" fashion between the rows. So, if the market value is at 5, and > three shares are sold, the value moves 5->4->3->2, which leaves the > stock price ending on a different row. From that value, the stock price > will again move "forward" or "back", linearly, during the operating round. > > An additional wrinkle to 1862 is that values have a tiered forward > progression. Depending on the value of dividends paid, a stock value may > move "forward" between 1 and 4 spaces. So, for example a company with a > stock price of 5 may move forward one space if they pay out between > 3-10, two spaces if they pay 11-20, three spaces if they pay 21-30, and > four spaces for paying 31+. > > (Note: all of these numbers are completely fictitious, as I don't have > my copy of 1862 in front of me.) > > Ultimately, this is really just a linear stock market with different > movement multipliers for different actions. The visual representation is > largely separate from the basic math. Rails can represent the 1862 > market entirely linearly, if we want. A single "forward" movement is > simply moving 2 spaces on a one-dimensional market, where a sale would > be a movement of -1 space. > > ---Brett. > > > > On Wed, Sep 10, 2014 at 11:26 AM, Stefan Frey <ste...@we... > <mailto:ste...@we...>> wrote: > > Follow up with details on 1860/1862 stockmarket: > > My understanding of the stockmarket of 1860/1862 is that it resembles a > hexagonal stock market with pointy topped hexagons (or East/West > orientation as it is called in Rails for 18xx maps). > > It has two rows of hexagons and wraps around at the upper/lower edge. > > In the following I refer to the definitions used by > http://www.redblobgames.com/grids/hexagons/. > > In axial coordinates we have the following: > > * The first coordinate is identical to the column number of each row, if > we assign the bankrupt field to the first column. > * The second coordinate is not vertical, but 60 degrees going from NW to > SE. It is identical to the row number (0 and 1). > > Using this for the 1862 stock market: Bankrupt hex has coordinates (0,0) > then 7 is (0,1), followed by 14 (1,0), 20 (1,1), 26 (2,0), 31 (2,1) etc. > > * Wrap around at the bottom implies that we jump from a "virtual" > coordinate (x,2) to coordinate (x+1,0) > * Wrap around at the top implies that we jump from a "virtual" > coordinate (x,-1) to coordinate (x-1,1). > > Selling shares implies a transition of (-1, +1): > > * From 26 (2,0) to 20 (1,1) > * From 20 (1,1) to virtual (0,2) => wrap around edges => 14 (1,0) > * From 14 (1,0) to 7 (0,1) > * From 7 (0,1) to virtual (-1,2) => wrap => bankrupt (0,0) > > Paying dividends is simply increasing the first coordinate according to > the number of spaces moved. > > A more complex version of a hexagonal stockmarket is used in 1854. > > Stefan > > On 09/08/2014 06:38 PM, Stefan Frey wrote: > > Mike: > > below you find a proposal how to restructure StockMarket. This is an > > example how I would like to change other components of Rails in the > > longer run. > > > > Please feel free to comment. > > > > I will write a mail on 1862/1860 stock market specifics later. > > > > Stefan > > > > Suggestions for a component structure. Example: Stockmarket > > > > Currently the core parts of logic, data and creation for the > Stockmarket > > is combined in one class: Stockmarket. > > > > A) Separation of Data and Logic > > > > The data parts of Stockmarket should be moved to a separate class > (e.g. > > xxxMarketModel). > > Possible classes depend on the StockMarket: > > e.g. RectangularMarketModel, HexagonalMarketModel, LinearMarketModel > > > > The logic part replaces the existing StockMarket class and contains > > method called from Rails that operate on the > > StockMarket, e.g. payout, withhold, sharesSold, etc. > > > > Most likely there will be some default Markets, like > RectangularMarket, > > HexagonalMarket or LinearMarket, but more > > specialized are possible. > > > > Customization should be possible in two ways: > > > > i) Internal configuration due to xml settings. > > > > ii) Implementing StrategyInterfaces that adjust part of the internal > > working of the default market. > > E.g. there could be a SoldOutStrategy interface, that allows to > change > > how the market behaves if > > shares are sold out after a stock round. > > > > B) Move Creation to a Builder/Factory class (StockMarketFactory) > > > > Creation of the StockMarket is then done by a separate class, > that wires > > together the different classes according > > of the needs of the specific 18xx. > > > > I prefer to use code to wire together Java elements, so no class > names > > should appear in xml files. This allows easier refactoring > > and code optimizations. > > > > C) Roadmap > > > > I offer to create the basic components for 1830 according to the > > structure outlined above. Then other > > stockmarkets can be modelled along these lines. > > > > On 09/07/2014 09:18 AM, Michael Alexander wrote: > >> Yes, it is extremely similar to 1860. It might be that the only > >> difference is that the one in 1862 is longer at the high end. > >> > >> No hurry on the response, there are plenty of other things to do. > >> > >> On Sun, Sep 7, 2014 at 3:09 AM, Stefan Frey <ste...@we... > <mailto:ste...@we...> > >> <mailto:ste...@we... <mailto:ste...@we...>>> wrote: > >> > >> Mike: > >> I will come up with a more detailed answer later today. > >> I have not played 1862 yet, however from a short glance, it > seems that > >> the stock market is similar to the one of 1860. > >> I would not recommend that path, instead please wait on my > thoughts, if > >> you do not mind ;-) > >> Stefan > >> > >> On 09/07/2014 05:42 AM, Michael Alexander wrote: > >> > And now that I'm looking at the stock market... > >> > > >> > I don't think I can use much of the existing Stock Market > class for > >> > it. It just won't fit in a rectangle. I could make a > new "Stock > >> > Market" class for this one and make the .xml file specify > which one to > >> > use. Should I take that direction? > >> > > >> > Mike > >> > > >> > > >> > On Sat, Sep 6, 2014 at 8:54 PM, Michael Alexander > >> > <out...@gm... <mailto:out...@gm...> > <mailto:out...@gm... <mailto:out...@gm...>> > >> <mailto:out...@gm... > <mailto:out...@gm...> <mailto:out...@gm... > <mailto:out...@gm...>>>> > >> wrote: > >> > > >> > I've pushed up my changes - I think I did it > correctly, please let > >> > me know if I messed something up. > >> > > >> > I have the Parliament Round mostly working. My next > step is to > >> > work on the stock market. > >> > > >> > > >> > On Fri, Sep 5, 2014 at 2:46 AM, Stefan Frey > <ste...@we... <mailto:ste...@we...> > <mailto:ste...@we... <mailto:ste...@we...>> > >> > <mailto:ste...@we... > <mailto:ste...@we...> <mailto:ste...@we... > <mailto:ste...@we...>>>> wrote: > >> > > >> > I will delay for a further day, as I will only > return on > >> > Saturday. Change of plans. ;-) > >> > > >> > > >> > > >> > > >> > Michael Alexander <out...@gm... > <mailto:out...@gm...> <mailto:out...@gm... > <mailto:out...@gm...>> > >> > <mailto:out...@gm... > <mailto:out...@gm...> > >> <mailto:out...@gm... > <mailto:out...@gm...>>>>schrieb: > >> > > >> > I unfortunately had something come up. Don't > wait for me. > >> > > >> > > >> > On Thu, Sep 4, 2014 at 1:03 PM, Michael > >> > Alexander<out...@gm... > <mailto:out...@gm...> <mailto:out...@gm... > <mailto:out...@gm...>> > >> > <mailto:out...@gm... > <mailto:out...@gm...> <mailto:out...@gm... > <mailto:out...@gm...>>>> wrote: > >> > > >> > I can get it to a state where I can do > that tonight. > >> > Thanks for the heads up. > >> > > >> > > >> > On Thu, Sep 4, 2014 at 12:56 PM, Stefan > >> > Frey<ste...@we... > <mailto:ste...@we...> > >> <mailto:ste...@we... <mailto:ste...@we...>> > <mailto:ste...@we... <mailto:ste...@we...> > >> <mailto:ste...@we... <mailto:ste...@we...>>>> > >> > wrote: > >> > > >> > Martin & Alexander: > >> > I have now rewritten a lot of the > tile and token > >> > lay UI code and intend > >> > a new alpha tomorrow end-of-day. > >> > So if you would like to merge some > code into > >> > rails_2_develop, there is > >> > some time left to do so. > >> > Good coding, > >> > Stefan > > > > ------------------------------------------------------------------------------ > Want excitement? > Manually upgrade your production database. > When you want reliability, choose Perforce > Perforce version control. Predictably reliable. > http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |