Announcement

Collapse
No announcement yet.

The First Economy Model Prototype

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Just D/Led and run. I like it, you have a good basis for an economy there!

    My suggestions for next version:
    1) move to a windows interface.
    2) A history graph would be nice (ie price vs time) so you can watch trends. This would be directly translatable to the full game, I would think. I realize this is not a trivial step, but it's something you're probably going to need to do at some point anyway

    Nice work so far, guys. Keep it up!

    Ron
    Manifest Destiny - The Race For World Domination
    -Playable Alpha now available!
    http://www.rjcyberware.com

    Comment


    • #17
      Heardie:

      I think I got one at turn 130something...

      But it's no big deal.

      I am actually posting because I have realized that I forgot something when I posted my replyes to the econ functions.

      the thing is that using the price calculator it is not certain that people actually spend the same amount of money as they earn - sometimes they end up spending more, sometimes they spend less - which is not good.

      Therefore a small modification to the price should be made beneath the other price calculator. This will mostly change prices a little, to make sure that money spent equals money earned. It wont make any big changes to the prices, though and their relative sizes will remain the same.

      Here goes (I am just posting the code):

      Code:
      if (pfood < 0.1)
      	pfood = 0.1;
      if (phousing < 0.1)
      	phousing = 0.1;
      if (pclothing < 0.1)
      	pclothing = 0.1;
      
      mfood = sfood * pfood;
      mhousing = shousing * phousing;
      mclothing = sclothing * pclothing;
      	
      mgoods = mfood + mhousing + mclothing;
      	
      mfood = (income / mgoods) * mfood;
      mhousing = (income / mgoods) * mhousing;
      mclothing = (income / mgoods) * mclothing;
      
      pfood = mfood / sfood;
      phousing = mhousing / shousing;
      pclothing = mclothing / sclothing;
      The first "if"'s make sure that prices will never be lower than 0.1 (this, not 1, should be the minimum price), the next part calculates how much money people spend on each good, then how much they spend on all goods, and then the amount of money they spend is multiplied with income divided by the total amount of money spent. This will make sure that the amount spent on each good is adjusted, so the total amount of money spent is the same as income. Finally the price of each good is calculated as amount of money spent on the good divided by the supply of the good.

      These algorithms are required to make sure that people don't spend more or less than they earn. they do not, however, change the overall prices (except for maybe lowering all prices with 2% or something).

      ------------------
      "It would sharpen you up and make you ready for a bit of the old ultra-violence."
      - A Clockwork Orange

      GGS Website
      "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
      - Hans Christian Andersen

      GGS Website

      Comment


      • #18
        I didnt know we had an economy proto!

        downloading it...

        Comment


        • #19
          Sorry VetLegion, I was going to send a message to the mailing list, but forgot.

          Joker: I have made the changes you suggested in the earlier post, and now it works much as you said by then. But unfortunately I didn't understand all of what you suggested in your latest message. But I will consider that idea and see what I can get out of it. I understood what your were meaning, that's not a problem.

          I will tweak a little the demand thing, and then add the possiblity to change the variables; that's done, I will be using the same code I wrote for heardie. Tomorrow I will have time to make it, so ver.0.1 should be available then. Yet, the demo hasn't been updated, so don't bother downloading it! I also try to comment the code better, it was clearly unfinished in the old version.

          Ron: I have been thinking about the win version. I have come to think, that I would prefer to make it not before the next version of the model, when it does more things. Now there's not much it does, so we won't benefit much from a windows version. Same applies with the graph, it would be always the same, since there is no dynamics in the demo that would come from changes in the situation (meaning population changes and such). Later, I think it might be possible to write the turn data into an excel sheet, and then make a graph out of that data. But that has to wait. Most preferably I would like to make the final UI system we will use ready, and then use that to make the visualisations of the model. Would save some workhours from me, since a windows-gui version would be "extra".

          Comment


          • #20
            My poiltical opinion (since you asked)

            I voted Nader. I knew he wasn't going to win, so I didn't vote "for Nader" specifically, I voted "Pro-Third-Party" to be more specific. If Nader wasn't on the ballot, I would have found another thirt party to vote for. I don't like having two guys that I don't want to see elected to choose from. This reminds me of Stalin's "free elections" in eastern europe of the 1940s, you could vote, but there was only one candidate you could vote for him or not. Well that's America, folks.

            I am totally against the stupid "Electoral College" stupid thing. It's an outdated notion from the 18th century and it needs to go. Al Gore (whom I don't want to see elected) is going to lose to George Bush (whom I also don't want to see elected) even though the American people voted him in favor by about a hundred thousand (out of a hundred million that's a very small margin) but anyway he's going to lose and we're going to have a bastard minority president because we're still stuck in the 18th century.

            And we like to think that WE'RE the most advanced?

            ------------------
            How will you make it if you never even try?
            -Macy Gray
            He's spreading funk throughout the nations
            And for you he will play
            Electronic Super-Soul vibrations
            He's come to save the day
            - Lenny Kravitz

            Comment


            • #21
              Well said, Guildmaster. I'm not against America or anything, but I agree that boasting about being the first in everything in my opinion requires also some actions to justify that.

              But then to business; I have made the upgradings that I wanted to do for this version of the model. Get the updated zip here: http://www.kolumbus.fi/amjayee/economy.zip It still lacks the price thing Joker suggested, but other changes to the formulas have been made as he suggested earlier. I also understood what Joker is meaning, and I think the model already should handle that kinds of situations, so I don't know if the system proposed is actually needed. Also comments have been placed as should, and there is a readme file for those unfamiliar with this project. So, now it's ready to be placed on the webpage. It does not matter if the old version is there, but it should be replaced with this as soon as possible.

              Now the systems seems to work towards an equilibrium better than earlier. I also "played" it until turn 650, and it didn't crash. But the equilibrium it reaches is bit on the odd side; farmer amount balances at 40000, and others at 30000 around the turn 200. But, in this situation the price for food is around 20, and others around 16. In spite of this, the amount of farmers doesn't rise but holds steady. This situation remained for the next 450 turns, as far as I noticed. I can't imagine why this is happening, instead of all prices balancing off at 15, which is the price index.

              Perhaps this is because we have the wrong amount of people, or the wrong amount of money? I added the possibility to change the key variables of the program, so you can experiment with it. I didn't have the time for that. Just edit the file config.txt. Don't change the order of the lines. Each line can have a descriptive text maximum of 80 characters. The text _must_ end with colon (':').

              Generally, I think now the prototype is much like it should, and we can start to design the next version, with companies and such. I can later make an update to fix the price thing, or any other things that arise.

              Heardie, I used much the same code as I wrote for you, so you can check how I used it. Your main interest might be the constructors of the Region class. If you want the descriptive text thing before the variable values, all you need is to add this line before each line reading a variable: in.ignore(80,':'); The characer between the ''s can be any ascii character.

              Well, at least the program doesn't crash anymore at the high turn numbers. I tested it until turn 650. If it crashes, please tell me what's on the screen, so I can track the bug. Because, for me it has never crashed, even with the older version.

              By the way, the odd-looking situation on turn 4, where the price of food is 1 and the price of clothing 11, is just normal (I think). The values of supply, demand, and elasticity are such, that price of food becomes negative and thus is set to be one, and price of clothing happens to become an integer.

              Enjoy the program, it should be better than the earlier version. Please report all problems.

              [This message has been edited by amjayee (edited November 14, 2000).]

              Comment


              • #22
                Guildmaster:

                Wow. I agree that Nader is the best candidate available. But on the other hand I would much rather have Gore than Bush. But let's not get into this now.


                Amjayee:

                Cool. I've just downloaded it, and it is definately better than the previous version.

                But I still see some weird things in it. For instance, the total income in turn 1 is 3000, but the income of each class is 300, and this should create a total income of 900. And I still think something is wrong with the supply algorithm (that decides how many people change sector). But this propably has to do with the function I gave you. So we should find a new function for supply, that doesn't make it jump back and forth between demand (and changing the price in huge jumps). But this may very well best be done with the next version of the model, where more factors play in the game.

                But no matter what we should make sure that the model will balance demand and supply way faster than it did. In the game it wont work if it takes 100 turns to reach equilibrium. If the conditions are right (sufficient raw materials and labour etc) equilibrium should be reached in just 3 or 4 turns.

                And I must admit, I have no idea why the prices wont balance at the PI, as they should.

                ------------------
                "It would sharpen you up and make you ready for a bit of the old ultra-violence."
                - A Clockwork Orange

                GGS Website
                "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
                - Hans Christian Andersen

                GGS Website

                Comment


                • #23



                  AAAARRRRRRGGGGGGHHHHHH!!!!!

                  Once again I have found a mistake in the formulas I have given you Amjayee.

                  In the price calculator I have divided with PI in stead of multiplying with it.

                  This is the formula I have used so far (for food):

                  E = D * 0.003 * PI

                  P = PI + (D - S) / E

                  When in fact it should look like this:

                  E = D * 0.3

                  P = PI + (D - S) * PI / E

                  Where E is elasticity, D is demand, PI price index and S supply.

                  What is really done here is, that the last part of the price calculator is multiplied with PI in stead of being divided by it. I am not sure how to explain this, but it means that when there is a lot of money a price change will not have as much effect on demand than when there is few money. This is pretty much the best I can do to explain it.

                  Just to make sure I am copying some code in here, to show how it should be:

                  Code:
                  dsfood = dfood - sfood;
                  dshousing = dhousing - shousing;
                  dsclothing = dclothing - sclothing;
                  
                  efood = (dfood * 0.3);
                  ehousing = (dhousing * 0.7);
                  eclothing = (dclothing * 1);
                  	
                  pfood = pindex + (dsfood / efood * pindex);
                  phousing = pindex + (dshousing / ehousing * pindex);
                  pclothing = pindex + (dsclothing / eclothing * pindex);
                  Also, I really think that to make sure that the whole price thing is accurate we need to have the minimum price to be 0.1 credits, and not 1. This makes it possible to have a price of e.g. 0.3 credits.

                  This last thing is not a big deal, but it is really easy to change, and in some scenarios it will make a difference and provide more accuracy.


                  Apart from this I am currently thinking about how to implement capital to the econ model. It will, however, require some more time before it will be ready.

                  ------------------
                  "In America, first we take the sugar, then we take the power, then we take the women!"
                  - Homer J. Simpson

                  GGS Website
                  "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
                  - Hans Christian Andersen

                  GGS Website

                  Comment


                  • #24
                    About income: No, the 300 figure is the income _per_capita_, (or per pu in game terms). This is what matters in the economy, doesn't it? 3000 instead is the income of all people counted together.

                    There is also some funny things for you to notice the big flaw of current computer technologies; the figures are rounded down, so the amount of people doesn't stay at 100000 when the sector changes are calculated, and likewise the total income is a little below 3000. But those things should not do much harm in the final system.

                    About supply and demand readhing an equilibrium, we don't need to worry much about that, since our system is quite restricted. Currently the only way to adjust supply is by the sector switching, and this is inadequate. In the next version that would be better in hand.

                    I'm thinking of a way to go straight to the turn 200 and then debug the system to find out why the problem with prices occurs. Has anyone been testing yet with other settings for the program?

                    Comment


                    • #25
                      Here is an answer to the question you made some time ago!

                      quote:

                      Originally posted by The Joker on 11-10-2000 11:39 AM
                      And that econ thing you read about:
                      Is it possible that you could post the system here or mail it to me? I have been searching the web for hours and hours without finding anything very useable, so eventually I just made up a system myself (the one we are using now), but if there is a better system out there we should use that! So I would really like to see it.



                      It's not available on the net, nor in a form that could be sent via email. I found it in a book of linear algebra I was reading. I can try and make a summary of it. It is mainly a calculation system, not an economic system, but we might apply that for some things in our model. Anyway it is interesting reading.

                      Comment


                      • #26
                        Income:
                        Ok, cool.

                        Prices:
                        I still can't figure this one out. But again, it is most likely due to the rather poor supply calculator we are using right now. So later on this problem should be removed.

                        Econ thing:
                        I would really appreciate if you could give me some resume of the thing you had read about. It might just be of help to us.

                        ------------------
                        "In America, first we take the sugar, then we take the power, then we take the women."
                        - Homer J. Simpson

                        GGS Website
                        "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
                        - Hans Christian Andersen

                        GGS Website

                        Comment

                        Working...
                        X