Announcement

Collapse
No announcement yet.

Population Model v. 0.1

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

  • #61
    I was thinking. Maybe to simplify disease handling we could make it so every person that dies (except of war and such things) would die form a disease.

    This would make the diseases an incorporated part of the whole pop model, and it would remove diseases as being just plagues. Diseases should exist throughout the game, and would mostly (when a pop has gotten used to them) just kill a few people each turn.

    ------------------
    "I chose not to choose life. I chose something else."
    - Trainspotting
    "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
    - Hans Christian Andersen

    GGS Website

    Comment


    • #62
      I have completed my pop model demo.

      Right now I am subscribing to some free website service, so you can download it.

      EDIT: Damn, I couldn't add files to the website I created - only text and images was allowed. In stead I will mail it to Heardie, and then he can upload it either to his site or to the GGS website (I think we should propably just upload everything we've got to the GGS website, just so it will all be stored in one place).

      It has really poor interface, but I can't change that yet. The program prints the amount of people in each age group one turn, and then the amount the next turn, using mortality rates and kids per family.

      It doesn't use any OO techniques yet. What I was thinking was, that population would be a class, and then the pop of each province of social class would be objects.

      It seems the program closes itself when opened, so right now the only thing useful is the sourcecode. It is propably not very good sourcecode, but this is the first "real" program that I've designed, so I'm happy about it!

      ------------------
      "I chose not to choose life. I chose something else."
      - Trainspotting
      [This message has been edited by The Joker (edited October 20, 2000).]
      "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
      - Hans Christian Andersen

      GGS Website

      Comment


      • #63
        I have been working on a simple pop class for the economy demo, so I could make the class and modify your code for it. Just let us know when we have the code somewhere available. Or is it somewhere? I couldn't find it at least on the webpage.

        Comment


        • #64
          i think they are at http://members.xoom.com/acchiron/pop.cpp

          Comment


          • #65
            Ok, I got it. It seemed ok, other than it's true ot could use some OO programming in it. I will make a new version of it as soon as possible. I will come back to it soon.

            Comment


            • #66
              Well, I didn't real intend to use any OO programming on it. After all, I started programming ~3 weeks ago, so I'm not really an expert. Therefore I figured that you, Amjayee, would propably be much better at turning the code into classes and objects than I would. I just made the function I had been working on, and threw it into the main() function, so I could test it and others could see what it did.

              But will this mean that the econ demo will include a pop model too, with pop changes etc????

              ------------------
              "I chose not to choose life. I chose something else."
              - Trainspotting
              "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
              - Hans Christian Andersen

              GGS Website

              Comment


              • #67
                Your program is remarkably good for a beginner, no doubt of that. About economy demo, it will not yet have population changes , but it will have a population class that stores the people-related economy data.

                Comment


                • #68
                  Ok. So I guess including a pop class in the econ demo will make it easier to implement pop changes, when we are ready to do that, right?

                  ------------------
                  "I chose not to choose life. I chose something else."
                  - Trainspotting
                  "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
                  - Hans Christian Andersen

                  GGS Website

                  Comment


                  • #69
                    I have been thinking about how to handle one rather important, yet unsolved problem with the pop model:

                    How do we calculate the mortality rates for each age group?

                    I mean, it's easy to say that mortality for kids should be 10% per turn, but what we need is an algorithm that takes in a very small amount of variables and finds the mortality rate for each age group (each of these would be different).

                    So, what should these variables be?

                    They could be these:

                    - Food per capita. I think if 1 PU eats more than 20 food per turn this should just have no effect. 20 would be a reasonable diet with a bit meat, some vegetables and bread etc. 10 per PU would propably mean the mortality of a population would only increase a small bit. It would be like eating a bowl of rise a day. Not healthy, but still it wont mean people will go ahead and die from it. Maybe this would cause the mortality of a population to rise with 5% or something (this would mainly be old people, of cause). When the food decreased even more mortality would start rising drastically. When the food per PU is down to 1 the mortality would propably be upwards of 97-99%. And when people have no food mortality would be 100%.

                    - Diseases present. I think we need to handle pop changes hex by hex, since diseases are handled on a hex basis. I think the disease model would combine all diseases present with the current resitance level of the population, and propably also include food per capita, since people are more likely to have diseases when they starve. Here the medical level would also have some effect on the mortality of each disease.

                    - Accidents etc. I don't really know if we need this. Has it caused many deaths throughout history?


                    I then think these things would be used to find 2 or 3 variables that are constant for this hex, and then put these into the following function:

                    Mortality = 1 - ageconstant1 * foodvariable - ageconstant2 * diseasevariable (- ageconstant3 * accidentsvariable)

                    Would this make sence? Also, we need to make sure that people per square km has some effect on the spread of diseases. Cities were virtually death traps before 1900 as they had a mortality rate that was constantly higher than the birth rate, and the only reason they survived is because of a constant flow of immigrants from the countryside. We should implement this.

                    But maybe adding all these features on a hex level would cause too many calculations needed by the computer? If we are to have over 1,000,000 hexes I can see why it should. But maybe we can save computer power by taking short cuts, like calculating all hexes with the same characteristics within a province all at the same time. But I don't know. I just think, that if we are to have diseases we have to do it properly, and to do it properly we have to have realism. And we are going to have diseases.

                    ------------------
                    Vote Gore. For the sake of people, not god.
                    "It is not enough to be alive. Sunshine, freedom and a little flower you have got to have."
                    - Hans Christian Andersen

                    GGS Website

                    Comment


                    • #70
                      Definitely. Also my intention is, that the basic structure of the class is the same as in the final game, so the only thing we need to do later is to add new classes and goods and the functionality for those.

                      Comment


                      • #71
                        quote:

                        Originally posted by amjayee on 10-30-2000 12:41 PM
                        Definitely. Also my intention is, that the basic structure of the class is the same as in the final game, so the only thing we need to do later is to add new classes and goods and the functionality for those.


                        Isn't it even possible for an underdeveloped C++ programmer to add goods and it functionality, because of the simplicity (but time spending) procedure to add these? Then even I or whoever wants to do it can implent these things, while the real programmers like amjayee, heardie and others can focus on the more difficult parts of the coding?

                        Comment


                        • #72
                          Elmo: Yes, the intention is, that other people could test the program and fine-tune its workings. This is a necessity, because we have so few programmers. Also slightly modifying the code should be quite easy, at least when it is not very much. Though I don't think it would be good to go tweaking the code itself, since that leads very easily to mysterious errors hard to fix. Instead, I try to put everything that is reasonable for the people to change in the game in a text file, so the workings of the program could be modified easily, just as I did with the map prototype (though modifying the map was not easy).

                          Mortality:

                          Yes, I agree, those are the key factors in that. Though the accidents are a little way off, I think. That could be dealt with the tech level. Every level should add some factor to the mortality figure.

                          Here are the things affecting the mortality listed as I see them:

                          -food supply: as you told. Perhaps 10 should be a "normal" level that does not affect mortality in any way? And doesn't eating too much affect mortality also? Not as much as eating too little, but still... remember the figure is an average.

                          -age structure: the more there are old people (proportionally) the more this affects mortality. Child mortality is completely another figure.

                          -diseases affect mortality "indirectly": they kill some people, and that is then added to the total mortality, after the other people have been killed. Some "common diseases" could eventually be made a constant effect on the mortality, that would just be added to the rate. Though this would be needed to check and change once in a while.

                          -wars have a similar effect.

                          -natural disasters, famines and so on also work in the same way.

                          About the effect on cities, I agree.

                          Also I agree that the calculations need to be done in per hex basis. It will be a strain for processor, but necessary. We will see if it causes problems, and find ways to simplify the calculations when it's time. I'm sure we will find solutions to all problems.

                          About the actual formula I cannot say, but it might work.
                          [This message has been edited by amjayee (edited November 02, 2000).]

                          Comment


                          • #73
                            Elmo:

                            I have thought about this, too. Especcially in the pop and econ models could this be done.


                            Amjayee:

                            I guess you are right, that accidents are too far off. So there would just be 2 factors determining mortality? The main problem is, that it is truly hard to find what mortality levels actually works...

                            I have found some age diagrams for modern day countries, and I should be able to use these to find some mortality rates in a modern civ. But ancient times is still a problem. We will have to do some research in this area.


                            Food supply:

                            Yes, what I had in mind was, that 10 food per 10,000 people would be the minimum level - the level just above starvation. A bowl of rice a day or something. So you're right that if people eat more than 10 food per day their mortality will not (directly) be effected by it. But 10 food per PU would not be a very balanced diet. Therefor anything below 20 or 30 food per PU would have an effect on the mortality of different diseases, since people are more likely to die from diseases when they don't get a balanced diet. So indirectly it would increase mortality even when people eat more than 10 food per turn. This is also how we can have the shrinkage of population that S. Kroeze has suggested. New epidemics would come along pretty often, but when people are well nurchered these wouldn't have a high effect. But then, when the land is overpopulated and people, although they don't starve, don't get a lot to eat, and an epidemic comes, it would be devastating!

                            Diseases:

                            I am not sure whether diseases should be divided into plagues (with Heardie's stats) and "common" diseases, like malaria. Dividing them would propably prove simpler and easier to do, so maybe we should do that?

                            Wars, disasters etc:

                            Yep, these would kill people directly, so they shouldn't be included in this "general" mortality rate.

                            ------------------
                            Vote Gore. For the sake of people, not god.

                            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


                            • #74
                              Dear Joker,

                              I hope the following suggestions and data are of some use. I do not pretend to have a solution to your current problems, but I am just trying to think along with you.

                              When I was obliged to choose between population counted by tile without age groups versus population counted by region with age groups I would definitely prefer the first alternative. In my view it is of the utmost importance to know how many people live, work and eat in a given tile. Without knowing that you cannot introduce migration nor development of cities, production etc. And the age groups are certainly interesting ,but when one would know the average expectation of life it would still be possible to calculate a realistic estimate of population growth under favourable conditions, without having age groups. Perhaps you should only count units of 1,000 or 10,000 people.
                              Another less radical solution would be to reduce the amount of different age groups. A system with only four or five different age groups could save the quantity of calculations. You could have children till 15 (after deduction of infant mortality), a group of 16-30 year, of 31-45, of 46-60 and the elderly (only in advanced societies). The only groups reproducing are of course the second and third.

                              The decision to make disease for the moment the only case of death seems to me a sound one! And you could without unreasonable distortion use only four different mortality rates for the various age groups, when you would decide to keep them: infant mortality(very high), and figures for children(quite high), adults(low), and the elderly(high). The words in brackets refer to a pre-industrial society.

                              I am very pleased you followed my convictions regarding the importance of sufficient food supply and its relation to disease. I also agree that when 10 food units would represent subsistence level (let's say about 2500 calories a day), more food would improve health. Not because it contains more calories but because people can afford to eat more expensive products, like meat and cheese. Many people on subsistence level are on a protein deficient diet.

                              I think I did already post quite enough figures about birth and death rates in an agricultural society. I'll copy some of the more important:
                              quote:


                              'Any agricultural society - whether sixteenth-century Italy, seventeenth-century France, or nineteenth-century India - tends to adhere to a definite set of patterns in the structure and movements of birth- and death-rates. Crude birth-rates are very high throughout, ranging between 35 and 55 per thousand and the average number of children born to a 'married' woman (using the term 'married' in its broadest connotation) by the end of her fertile period (at the age of forty-five or fifty) is at least five. Within the above indicated range, the actual value of the birth-rate in any given agricultural society varies according to numerous factors: age and sex composition of the population, sanitary and economic conditions, the prevalence of war or of peace, and, last but not least, socio-cultural factors such as the attitude toward marriage, the attitude toward birth-control etc. Death-rates are also very high, but normally lower than the birth-rates - ranging generally between 30 and 40 per thousand.

                              The population of an agricultural society is characterized by a normal rate of growth of 0.5 to 1.0 per cent per year.

                              In normal times, a large proportion of the deaths were represented by infant mortality. Of 1000 newborn children, 200 to 400 died within a year. Many of the remaining ones died before reaching the age of seven. A famous sixteenth-century physician, Jerome Cardano of Pavia, used to maintain that he could cure anyone on condition that the patient was not younger than seven or older than seventy.

                              The high toll of infants and youths drastically reduced the average length of life. All available information for numerous societies seems to indicate that the 'agricultural' life expectancy at birth generally averages twenty to thirty-five years and of those who reach the age of five few have good chances of surviving beyond fifty.

                              The prevailing high birth-rates have distinctive effects on the age composition of agricultural populations: the number of young people is very high. In general, between one third and one half of the population is below 15 years of age; in other words, the population pyramid of an agricultural society is very broad at its base. From an economist's point of view, this means that the young non-productive population represents a heavy burden for the active adult population and this is one of the reasons why agricultural societies put children to work at an early age.'


                              (source: C.M.Cipolla:'The Economic History of World Population',1962)

                              I would like to add some figures: all ~1900AD
                              birth-rates / death-rates (per thousand):
                              India: 48.0 / 43.0
                              Mexico: 46.0 / 32.9
                              Egypt: 45.2 / 26.5
                              Russia: 48.0 / 29.5

                              Infant mortality (total infant deaths per thousand live births):
                              India: 232
                              Chile: 264
                              Russia: 260

                              Expectation of life at birth / at sixty:
                              India: 23 / ?
                              Russia: 32 / 14
                              U.S.A.: 48 / 15

                              And finally some information about pre-agricultural conditions:
                              'Some time ago the belief was common that early man's fecundity was lower than that of civilized man, and that this was the main cause for the small size of Paleolithic societies. Today this theory is generally disregarded. We do not possess reliable figures, but indirect evidence supports the view that the Paleolithic populations had very high mortality. Since the species survived, we must admit that primitive man also had a very high fertility.

                              High mortality and high fertility were associated with a short average length of life. Here we run into the difficulty of extremely poor information and we can express our concept only in rough quantitive terms. By analysing fossil remains of 187 Europeans of the Neanderthal group, Vallois was able to ascertain that "more than a third died before reaching the age of 20, and the great majority of the rest died between the age of 20, and the age of 40. Beyond this limit, there are only 16 individuals, most of whom certainly died between the age of 40 and the age of 50." Weidenreich, analysing the fossil remains of 38 individuals of the Asiatic Sinanthropus population (a much earlier group than the Neanderthal) substantially confirmed the results of Vallois. Out of 38 Sinanthropi it was possible to assess probable age at death for 22. Of these, it seems that 15 died when less than 14 years old, 3 died between the age of 15 and 29, 3 between 40 and 50, and only one seems to have survived beyond 50. These figures are vitiated by a number of factors and their real meaning if highly dubious. They refer to quite different generations of people, they tend to disregard infant mortality and their number is too small to represent a reliable sample. However, evidence collected for hunting-stage societies of historic times generally agrees with these findings. The age of fifty is rarely attained and "the centre of gravity of these societies moves toward the lower-age groups".

                              In regard to causes of death, Weidenreich observed that most of the fossil remains of prehistoric man clearly indicate a violent death. For Paleolithic man of historic time, Krzywicki arrived at a similar conclusion, observing that the most frequent causes of death were infanticide, war, and headhunting.(!) Acsádi and Nemeskéri point out that, in general, death was closely related "to accidents, violence, and diseases resulting from factors of the natural environment or their changes". The low density of population was in a way a protection against epidemics. It is indeed difficult to see how, with spare populations organized into small bands wandering over limited territories, contagious diseases could have had the importance that they have assumed under other demographic conditions. But it is not diffcult to believe that starvation and diseases connected with nutritional deficiences must have taken on the whole a heavy toll of human life in Paleolithic and Mesolithic societies, especially among infants.'
                              (source: C.M.Cipolla:'The Economic History of World Population',1962)

                              I honestly think that combining the figures presented(expectation of life, distribution of the age groups etc.) could result in a both workable and realistic model for the pre-industrial period. My advice is to try to fill in the missing parameters and to compute the results on the longer term. I hope I do not sound too high-handed? I am actually too lazy to do it myself. And mathematics was really never my strongest point!
                              You can always fine-tune the rough results and add new factors influencing birth or death rates.

                              Is it already decided that GGS will start in 4000BC? As you probably know I am rather interested in the millennia before. Quite an interesting thread is In the beginning: An article about Ancient Civilization

                              Best wishes!
                              Jews have the Torah, Zionists have a State

                              Comment


                              • #75
                                I have been thinking a lot about the pop system (how to handle population and age) lately, and I have some dificulties implementing both a hexbased pop model, and a province based age group system.

                                Basically to have diseases work properly we have to do them hex by hex. But at the same time we have to have age groups be done on a province level, since the required amount calculations would just be too large, if age groups should be done on a hex level with over 1,000,000 hexes on a map.

                                But we can't just seperate the two. Diseases pretty much decide how many people die on each hex, but at the same time we will have to calculate how many people die in each age group in the entire province, and have the total amount of deaths in all hexes to be the same as the total amount of deaths in all age groups.

                                How do we do this properly? Maybe I am just obsessed with pointless details, or maybe this is just not hard to do. But I just can't find a sollution right now.

                                ------------------
                                Vote Gore. For the sake of people, not god.

                                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