 |
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
Hi all!
I have now finished the first phase of making this first prototype, so I felt like sharing it with the rest of you. Get the zip from here! http://www.kolumbus.fi/amjayee/economy.zip 
Actually this is not yet the prototype version 0.1, but something like 0.09; I was planning to make it a little better, but I think it's good to finish it together.
The program runs now stable, I couldn't crash it; but of course I didn't have time to test it for very long time. So, if it crashes, send me email and include the text that is on the screen when it crashes, and the possible error messages. At least divisions by zero may occur, since I didn't have time to make very extensive exception-handling.
Also the program works much like expected; at least during my short tests the prices found an equilibrium, and the demands balanced around the supplies. Though it seems that clothing producers were getting clearly the poorest and the housing producers clearly the richest. The largest problem I want to fix is that demands are changing too rapidly; they jump back and forth around the supplies, instead of holding still. But otherwise I'm quite satisfied with the new demand algorithm; it is actually the first piece of AI in our game, since it analyzes the situation, reacts to events and tries to find the best solution to a situation. It is by far the most complex thing in the prototype.
There are of course many funny things in the program. First of all, it is kinda ridiculous that the balance is found by adjusting the prices so they fit the wealthiness of the people. But that's the limitation of the set for this prototype. Later it will be corrected.
I am going to send here a summary of the algorithms I'm using in the program, but now I haven't time, I'm at school and lectures are starting. This evening I will send those things. Until that, test the program, and if you like, check the code out. Though it is quite complex, and only partially commented right now. Also send me comments how I should improve the program for the real "version 0.1" of the prototype. I was going to add the possibility to change the program variables via a text file. What things should be change-able? And what things should be shown as results on the screen?
After my second message you can comment the algorithms also. They are mainly the same as presented by Joker; the demand system is re-made, and I made a change to the elasticity calculation. In its old form, the prices were changing very slowly, so I divided the elasticity by 1000. Now it seems fine.
I hope the link is working. As said, I will come back to this this evening. Enjoy that piece of programming s***. 
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Nice!
I've just downloaded it, and I am checking it out right now!
------------------
Vote Gore. For the sake of people, not god.
GGS Website
|
|
|  |
 |
|
Guildmaster
|
|
Up your butt and around the corner
Jun 2000 time: 05:14
|
|
I just wanted to say that I think it's wonderful that Florida (My home) has become thee deciding factor in this presidential election. =)
And now the eyes of the world are upon us as we get our recount in... (Go third party!)
------------------
How will you make it if you never even try?
-Macy Gray
|
|
|  |
 |
|
Guildmaster
|
|
Up your butt and around the corner
Jun 2000 time: 05:14
|
|
I noticed that there is no equilibrium...
When the income of a certain field goes down, no one wants to go into that field, that's why no one wants to be a teacher in America. So in the demo I noticed that when the number of clothing producers went up, their income went down with the demand. But when the income goes down so should the number of producers.
Also same thing when the income of a field is high, a lot more people want to go into that field. There are for example, more people going into business management, law, and medicine than there are people who actually want to be business managers, lawyers and doctors simply because they want to make more money.
Other than that I see no real problems.
------------------
How will you make it if you never even try?
-Macy Gray
|
|
|  |
 |
|
Guildmaster
|
|
Up your butt and around the corner
Jun 2000 time: 05:14
|
|
Actually no, I see more... let me play with it a while and I will get back to you
------------------
How will you make it if you never even try?
-Macy Gray
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
When I tested it more I also noticed that clothing price keeps going down for some reason. Right now I'm too exhausted to find out why, but later I will go back to it. Keep testing and report all problems! Also if you notice why the problem occurs, that is nice!
It is also possible that all problems cannot be solved simply because the system is so limited. But we will find out about that. Also send comments about how to make the demo better!
Now I'm sending the formulas I use in the demo, so you can track problems more easily. These are mostly the ones presented by Joker, slightly modified by me. I have also combed the thread for smaller bits of information and used them in creating this, so it's a creation of all of us!
The demo consists of unlimited number of "turns". Each "turn" of economic consists of separate things that are done in this order:
-supplies of all goods are calculated
-elasticities of all goods are found
-all prices are adjusted
-demands of all goods are decided
-goods are sold to the people
-people's incomes are adjusted
-people changing classes are calculated
Then how these tasks are done? Here is a short explanation of each one of those.
Supply:
This is the amount of units each good is produced per turn.
S = w * u
w = number of workers producing this good, in population units
u = good units produced per PU per turn
A population unit means a group of 10000 people, and it is just an utility figure to allow calculations with smaller numbers.
The amount of goods made per PU is 20 in this demo. It is the same for all goods. Later we might want to make that different for all goods. Also I'm planning to make this figure adjustable by the user so we can easily test different situations.
Elasticity:
This describes how the price of the good will change.
First we find the price index. This means the total amount of money on the move divided by the total supply of all goods.
E = D * e * PI / 1000.
D = total demand of the good
e = elasticity constant
PI = price index
The elasticity constant is characteristic for each good; for food it is 0.3, for housing 0.7 and for clothing 1.0. This should perhaps be made adjustable, since I think at least for clothing it is too high. And it might be good to be able to test different combinations. Also the figure with which the whole crap is divided should be made adjustable.
Price:
This is the price per good unit in credits.
P = Pp + ((S - D) / (D * E))
Pp = previous price of this good
S = total supply of the good
D = total demand of the good
E = elasticity
In the beginning, price = price index and then it will start to be adjusted by supply and demand. The workings of this formula are clear; when demand is greater than the supply, price will lower, and when supply is greater, it will rise. The speed of price changes depends mostly on elasticity.
Demand:
This is much more complicated than the previous ones. There is no simple formula to determine the demands; that is impossible, since we have to take into account all goods simultaneously.
Instead, we first analyze the situation using a figure I call Finances: I tells the amount of money left, if all demanded goods are bought with current prices. This can of course be also negative. It is calculated like this:
F = 100 * ((I - C) / I)
I = income per PU
C = total cost of goods
C is calculated by multiplying the demand of each good with the price of that good, and then summing those figures. So you see this is indeed the percentage of money left after the purchases.
Then the finances figure is used to determine how to change the shopping habits. If it is negative, demands are dropped, if it is positive, demands are rised. I will later explain this in full length, but first I need to balance it, since now it works too "eagerly" and demands jump back and forth around the supply figure.
Selling Goods:
There are two kinds of situations: either the demand is smaller than the supply, in which case everyone can buy the amount he wants. But if supply is smaller than demand, there are not enough goods to sell. So, how I did this is:
B = S * (d / D)
S = supply of the good
d = demand of the class in question
D = total demand of the good
So, everyone gets the same percentage of the supply as his demand is of the total demand. This is done for every class and every good.
Income:
This is the amount of money available per PU.
I = ((f / F) * M) / a
f = the amount of money produced by that class
F = the amount of money produced all in all
M = the total amount of money on the move
a = amount of population units in that class
The f - figures are calculated by multiplying the supply of that class' product with its price. The big F means the figures of all classes summed up. So, each class gets the same share of the total money as the money he has produced id from the total amount of money produced.
This is kinds funny of course. I tried a system where people got just the amount the had earned with their work (supply multiplied with price), but for some reason the incomes kept getting smaller and smaller until they were reduced to zero. I think this is because the set in this demo is quite limited, we can't use very fancy systems because they don't work.
People changing classes:
At the end of turn we assume that 3% of the people want to change their class. This is done like this:
A = 0.97 * Ap + ((r / R) * p)
Ap = previous amount of people in that class
r = ratio of that class' product's demand / that good's supply
R = total of every classes r's
p = the amount of people changing classes = 0.03 * total population.
The r - figures are greater than 1 if supply is smaller than demand (-> supplly needs increasing -> more people are needed) and smaller than 1 if demand is smaller and less people are needed.
So, each class gets the share of the people it "needs".
----------------
Well, that's about it for now. I will work with the demand system and then explain it in greater detail. The greatest addition I have been thinking is some kind of simple "immigration". The current system does not find very good balance between the figures; if some people could get out of the region if there are too much people, or more would come if needed. I will think how this would be done.
[This message has been edited by amjayee (edited November 08, 2000).]
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Yes, like Guildmaster I see some problems in the demo.
At least concerning the supply algorithm. In stead of all the prices moving towards being the same for all goods (which they should) they move away from each other.
But I, too, am too tired to think more about it right now.
It is really, really great that you, Amjayee, have posted the formulas you have used here at the forum. I tryed to check the sourcecode to see if I could find the bugs, but there was just too much of it and it was too advanced for me to understand it. This is a great way to improve the demo.
And BTW, Amjayee, you wrote in the econ thread that you had never programmed anything as complex as this, and that you had learned a lot from the experience. Isn't this great? I mean, this is one of the things I like best about GGS, that you have a task, that you pretty much define yourself with the rest of the group, and then you have to figure out a way to do it. It usually seems WAY to hard to do it when you start, but then you think and think and think about it, and you manage to break the task into smaller, easier done tasks, and when you finally see how things can be done it is just fantastic! Even though I don't go to school this year (I am taking a year off to work between highschool and university) I feel I have learned a lot of really great things thanks to GGS.
Also, Guildmaster, it is pretty wild the stuff going on in the US at the moment. I can't believe 1700 votes are deciding it all (you really should change your electorial system). So who did you vote for? And cool new sig you have got!
------------------
Vote Gore. For the sake of people, not god.
GGS Website
|
|
|  |
 |
|
heardie
|
|
Kick ass, Amjayee, I'm downloading it now.
Joker
-------
I agree. I am learning C++, but instead of from a book (which I also use), I try programming things, i.e. I am working on the disease model, and you will soon see it where it has a limited interface, customizable diseases(in the game, and text file), and the ability to create your own disease.
If I can get it to work that is!
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
About prices becoming the same, it's funny that it _used_ to do just that. But I thought that it is unrealistic if all goods have the same price, so I changed the algorithm just to get them different. If we replace the last price with price index in the price formula, we get all prices balancing on the price index when supply equals demand; but I don't see why the prices should be the same. I mean, don't different goods have different prices also in reality? Or is it that I just don't understand something? 
About learning while working with this project, I agree! It is a fantastic feeling to get something ready after lots of work, if you really care about the work you are doing. Myself, I was quite angry when the economy program did some foolish things, but when I solved those problems, I felt very happy. It's the same with programming in general; it gives unlimited satisfaction to succeed in some task, rising exponentially with the complexity of the task.
I'm quite sure that we are able to solve all the problems with our game; it just needs trying, and learning new things. It may take long, but if we don't give up, we will eventually reach our goals. This far every idea presented is completely within reach with current technology. We just need to do what needs to be done.
Heardie: Great! I'm sending you a function reading the text file this evening.
About the US elections, I agree it's a little odd that those two guys got almost the same amount of votes. I don't think that's because of the voting system, but just that they are so close to each other that people don't know which one to vote. About the voting system itself, I think it is about perfect for the kind of country the US is; with that system, the states get more power, and I think one of the keys to succes of the US is that the states are quite independent. So, with current system, every state chooses their favorite candidate, and the amount of states supporting each (balanced with factors depending on the state population) decides the winner. But what is bugging me is why didn't they vote for the third guy? He seemed to have at least some opinions. Having only two parties in power doesn't sound very good for democracy.
[This message has been edited by amjayee (edited November 09, 2000).]
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Heardie:
Say, what book are you using? I saw your disease program source code, and your comments seemed a lot like those the auther have made in the book I'm using. My book is called 'Teach yourself C++ in 21 days'.
Amjayee:
Prices:
Well, they should become similar, since if the price on one good is high then more people will invest money in the production of that good, supply will rise and the price will drop. And vice versa. So in this demo the prices on all goods should become the same within a few turns.
Later on when we have a labour market and raw materials these things will most likely mean that the prices can't become the same, even though the price algorithm will try to make them that.
You also said that it didn't seem right to have all goods cost the same. I can see your point there. But on the other hand we are not using real goods. 1 unit of a good is highly an abstraction. And in the game, when you want to decide whether buying some good is a good idea, it will be a lot easier to figure that out if all goods at least have the same "basic" price. So if the conditions are similar (in many areas) one car unit could cost the same as one food unit. Maybe later on we could change the unit size, to have more realism, but we should definately NOT change the price algorithm so the prices will not become similar. That is not how a market works.
US elections:
Well, what I meant was, that it is not very democratic to have Gore get the most votes, but not winning the election. That is why I think they should change their electorial system. But I agree that more people should have voted for Nader. He made a lot of sence, and was propably more suited for the job than both Gore and Bush.
Ok, now I will comment on the functions you are using:
Supply:
This is all good. You are completely right that productivity should of cause not be the same for all goods, and that it should change as tech levels rise. We need to find out some actual productivities at different tech levels, and use them.
Elasticity:
Yes, it is ok. But in stead of using an elasticity constant and then dividin the whole shabang with 1000, I think we should just have a really small elasticity constant. The constant shouldn't change in the game. Generally the more basic the good is, the lower the constant. So luxury goods would have higher constants. And I agree that the constant for clothing is too high, since clothing is a basic good. It is just that with only 3 goods I thought it would be good to see how they react with different elasticities, and I found clothing to be the least basic of the 3. Again we need to find some actual elasticity constants in the game.
But I am not completely sure you have used the right constants. In my econ code I used this formula:
E(food) = D(food) * 0.003 * PI
E(housing) = D(housing) * 0.007 * PI
E(clothing) = D(clothing) * 0.01 * PI
Where PI is price index or (total amount of money in the province) / (total supply of goods)
I think your function have divided this number by 10. I know that in your model the prices seem to be pretty good, but I think you should at least try and change it to this, and see what happens.
Price:
Ok, here is, as I explained before, the main problem. Not only does this explain why the prices move away from each other, it also explains why you had to divide the elasticity function with 10 to get sane results. Here is what it should look like:
P = PI + (D - S) / E
P is price, PI is price index, D is demand, S is supply and E is elasticity.
First, using PI as the basic price is required, since this would be the price if supply and demand is the same. Second S - D should be changed to D - S, since E is positive. So if demand is higher than supply then the last part of the function will be positive, and it will mean that the price will be higher than PI, since there are more buyers than there are sellers of the good. And if supply is higher than demand the price will be lower than PI, since there are more sellers than buyers, which pushes the price downwards. And in the last part of the function D * E should be replaced with E, since D is already included when calculating E. This is the reason why you had to divide E with 10 in your function, since it would be multiplyed with D two times in stead of one.
Demand:
Yep, this is a tricky one. I had made it a long list of 'if''s, but of cause when people demand 100s of goods this wont work.
I can't really figure out how your algorithm for it would work, though.
I am trying to make the amount of calculations needed in my version smaller, so it could work with many more goods. That is mainly because I REALLY, REALLY like how it has turned out. I have spent virtually months trying to figure out how to make the econ model work, and the demand thing was the most dificult of all. I finally managed to make demand independant of income (and just dependant of the amount of goods, in stead), and I made sure that people spent the same amount of money that they earned, which I really liked.
Selling goods:
Yes, this is how I thought demand with different classes should work. But it should also function when supply is higher than demand. In that situation price will drop, which will encourage people to buy more of the good that they originally thought they would. And there, too would the amount of goods they get depend on their demand compared to the total demand.
Income:
Hmm. When I read it I thought the same as you wrote later on - that it would be simpler to just have this be the amount of money they earn. But wont the result in this case the the same than if the simpler system was used? In other words, isn't F and M the same? I mean, M is the amount of money spent on goods. And F is the amount of money earned from selling goods. And aren't these two exactly the same?
People changing classes:
Yes, this is pretty much the system I suggested. But one thing: In stead of using r's, it would be simpler, and more accurate, to use the prices of each goods. So in stead of using
A = 0.97 * Ap + ((r / R) * p)
we should use
A = 0.97 * Ap + ((p(good) / P) * p)
where p is the price on that good the last turn, and P is the prices of all goods added (P = p(food) + p(housing) + p(clothing)). The results are pretty similar, only this is a bit better, since the price is actually what should decide what people want to produce.
Later on, when we have capital and raw materials, I would like to have a more elegant "people changing classes" function. But for now this is great.
Ok, finally I am done. Please don't take all this critique the wrong way. The econ demo is a fantastic tool, and it has put us far ahead in the project. Sure, some algorithms should be changed. But that shouldn't take long to do. And the demo still have a lot of really, really useful features, like population and other things. This will make it much easier to put the model on to a map, when it is ready for it.
So generally it is a great program. When the minor bugs are gone we are ready to play around with it, and we can proceed!
------------------
Vote Gore. For the sake of people, not god.
GGS Website
|
|
|  |
 |
|
Guildmaster
|
|
Up your butt and around the corner
Jun 2000 time: 05:14
|
|
Ok this is my thought...
Fluctuations is prices, incomes, supplies, demands, etc. All this happens because of forces that can be totally outside the base economy model. If we use the economy model as a simple object for determining stuff like that, then as a stand-alone demo it should reach a point of perfect equlibrium where nothing changes. That is, if it is all by itself. When you plug the Econ model into the population model you should see the numbers go haywire.
So this is I think on the next agenda:
Program an economy model that will reach perfect equliibrium, and then accept input from the user which may change the outcome of the next phase, something like "food-supply-minus4" or something like that. Then it should change accordingly and after a while of recieving no further input it should go back to the original state.
------------------
How will you make it if you never even try?
-Macy Gray
|
|
|  |
 |
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
About US elections: on federation scale it sounds undemocratic, but I think it makes sense considering the high level of independence of the states, as I said in the earlier. And I agree about Nader, he should have won. It seems that the Americans are too fixed on the republican-democrat axis so they can't think of any other parties or candidates.
About your feedback: No, I think it was great! It's good to have someone who has spent more time thinking about the model to comment the formulas. I had the problem that I didn't understand the model very well, so I just had to make it work somehow. I think I will do just as you said for the final formulas.
About demand&selling: actually the selling thing only sells the people what they want. The demand thing finds out what the people want to buy, and this depends on supply and their financial situation. Basically the algorithm is one large if -if else - else statement, that goes through several options of the financial situation (what is the value of finances variable). Then for each option it adjusts the demands of the goods so that the finances are positive. If they are positive right from the beginning, demands are rised slightly. But in the demo demands change too rapidly, which I intend to fix. But if a better way to do this is found, it can be replaced.
Guildmaster: I agree that equilibrium should be the goal. When combined with population and other models, the situation will change every turn, so each turn we would need to make corrections to remain as close to the equilibrium as possible. That should be the duty of the economy model; try to "normalize" the situation. I just today read some interesting things about a modeling tool used by economists, which was said to find an equilibrium in a system modeling flow of goods. It uses linear equations, and I'm certain that would be well within reach of my mathematical skills. And since computers are just like made for handling linear systems, we might get somewhere with that kind of system. Also that way the amount of calculations needed by the machine might be lowered. I'm examining that possibility.
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
Guildmaster:
Yep, this is what I had in mind, too. The econ model will be sort of an object that simply logs on to a region's stats and returns some new ones.
In itself it will move towards equilibrium, but with technological advancements, pop changes, trade etc equilibrium will be really, really rare in the game.
And I agree that a txt file with the econ model, in which everything could be changed (including pop, supply, income, amount of money in the game etc etc) so it is possible to "save" the stats from the econ demo, and then go to the txt file and change something - like productivity or pop, and see what happens.
I hope this wont take too long to program, cause I am really eager to add to the demo - a pop model where mortality is based on the amount of food people eat, capital, capitalists and workers etc etc!
I really look forward to all this!
And also: Who did you vote for?
Heardie:
Yeah, I thought you were! It's a pretty good book, BTW (not that I have anything to compare it with, but still...). So how far have you come in it? UI am on day 7 now, but of cause I have spent more than 7 days to do that, since I can't read all day. Unfortunately I have been to buissy to read further in it for the last few weeks.
Amjayee:
Elections:
Hmm... I see your point, but I think the president should be elected by the people, not the states (electing a president without a majority of the pop voting for him isn't very good democratically), and then the states would have some rights and be in charge in some areas (like they are).
My feedback:
Thanks! 
Selling goods:
Do you mean that if supply is higher than demand then the goods that are left over wont be bought? If so then I must disagree with you. It is all a matter of price. Demand is really just the demand when the price of the good equals the price index. If supply is higher than demand then the price will drop, and people will buy more of it, untill they buy the same amount as the supply.
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 would sharpen you up and make you ready for a bit of the old ultra-violence."
- A Clockwork Orange
GGS Website
|
|
|  |
 |
|
heardie
|
|
Anyone else's program crash at turn 106?
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
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
|
|
|  |
 |
|
VetLegion
|
|
I didnt know we had an economy proto!
downloading it...
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
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".
|
|
|  |
 |
|
Guildmaster
|
|
Up your butt and around the corner
Jun 2000 time: 05:14
|
|
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
|
|
|  |
 |
|
amjayee
|
 |
Jyväskylä, Finland
Oct 1999 time: 07:14
|
|
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).]
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
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
|
|
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|

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
|
|
|  |
 |
|  |
 |
|
The Joker
|
|
Copenhagen, Denmark
Aug 1999 time: 06:14
|
|
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
|
|
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|