Civilization model

Civilization model preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 5.2.0 • Viewed 958 times • Downloaded 89 times • Run 0 times
Download the 'Civilization model' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

My model is designed to show a simplified economic view of civilizations and to test what the most efficient traits are for these civilizations to possess, along with checking how much of an impact frugality has on economic growth.

HOW IT WORKS

To begin, the setup button sets up two “islands” made of green patches with the size of the islands based on a slider in the interface. I randomly choose the location of 3 x 3 yellow, red, and dark green patches, to represent gold, food, and wood, with the number based on the sliders in the interface. I also randomly choose the location for a “town center”, which is a 3 x 3 brown patch. I run this process for each island, with the result being two different looking islands with the same number of multicolored patches. All the patches that are not on the island are colored blue, and treated as “water”. There are red patches north of each island, designed to turn green when the island is “finished”, meaning all of the resource patches are gone.

When the go button is pressed, the turtles begin to wander randomly. If they run into a water patch, they turn around and keep wandering. If they run into a resource patch, they call the appropriate workers to collect resources from that patch, and the workers continue to collect from there until the resources in that patch are gone, in which case the patch ceases to be a resource patch.

There are several strategies in the strategy choosers. The first strategy is called “workers”, and after go is pressed, civilizations with this strategy check whether they have enough resources to create a worker (which costs 50 food), and if they do, then they create one. The second strategy is called “buildings”, and civilizations with this strategy check to see if they have enough resources to create a building (which costs 300 wood) and create one if they do. These buildings correspond to certain workers, and raise the maximum amount of resources that they're allowed to collect. The third strategy is called “trade”, and civilizations with this strategy check to see if they have enough resources to build a dock (costs 800 gold) and create one if they can. Creating a dock also creates a boat which moves around the border of the island. When it leaves the dock, it takes 50 of the highest resource possessed by the civilization, and when it returns to the dock, it brings back 50 of the lowest resource possessed by the civilization. The other strategies are combinations of these three, with "neutralfocus" being a combination of all three.

HOW TO USE IT

There are several parameters in place to test this model. There are monitors recording the resources of each civilization, along with the total resources of each civilization. The total resources monitors only factors in positive resource gain, to focus on income rather than profit, in order to not discourage spending. Included is a switch called “tprof” which includes trade income in the total resources but, again, only includes the positive resource changes. For tests, this switch remained off, since there is no net resource gain from trade and therefore this creates slightly misleading results. There is also a plot included which graphs the total resources of each civilization. There are several other sliders, which were used to set up the island, and can be altered to run different experiments. There are also frugality sliders, designed to set a spending limit on each of the civilizations. The computerrun switch should be kept on, although turning it off shouldn't affect the model. The island setup sliders, which is every slider below the strategies, can be altered in any way, but are set to values that create quick and useful tests.

THINGS TO NOTICE

Observing the slope of the production plot is interesting because it varies greatly with different setups. Watching the spending of civilizations with the "neutralfocus" strategy is interesting because many transactions occur and all of the resources fluctuate depending on the efficiency of the civilization. Testing civilizations with the "none" strategy against civilizations with other strategies can show an interesting

THINGS TO TRY

Changing the strategies can lead to very interesting comparisons and observations, along with observing the production plot and how it looks with different strategies. Seeing how frugality interacts with different strategies shows some interesting observations as well.

EXTENDING THE MODEL

If I could expand this model, I would create interaction between the civilizations, which would perhaps add more depth to the trading strategy. I would also create benefits to frugality, which would allow for a more in depth comparison between spending and saving.

NETLOGO FEATURES

This model uses BehaviorSpace to test out and compare the different strategies, and also to test and compare different levels of frugality.

RELATED MODELS

A related model is the Artifical Anasazi model, which also attempts to model the growth of a civilization. This model focuses more on the survival aspect of civilization, while my model focuses more on the economic aspect.

CREDITS AND REFERENCES

Thanks to Uri Wilensky for helping me find interesting and relevant phenomenon to base my project on.

Thanks to Arthur Hjorth for greatly helping me figure out a direction for this model when I was at an impasse and giving me advice throughout the course of the project.

Thanks to Bryan Head for assisting me with specific programming issues, especially with boat movement issues, and for creating his Controlflow extension, which saved my life.

(No offense to David Weintrop, I'm sure he's great too).

Comments and Questions

Info

First step of my civilization model. Swordsman doesn't work yet

Posted over 10 years ago

Click to Run Model

__includes ["setup.nls" "islandcreate.nls" "movement.nls" "creation.nls" "boatstuff.nls" "strategy.nls"]
extensions [cf]

globals[randomxpos randomypos goldminecount forestcount berrycount homexpos homeypos homexpos2 homeypos2
  goldpatch foundgold woodpatch foundwood berrypatch foundberry homepatch food wood gold fooddecrease foodcounter
  goldpatch2 foundgold2 woodpatch2 foundwood2 berrypatch2 foundberry2 homepatch2 food2 wood2 gold2 testingstuff
  locationxpos locationypos foundspot havetemple locationpatch buildpatch needtobuild buildcolor totalresources
  currentplayer foodweight woodweight goldweight foodweight2 woodweight2 goldweight2 strategyset strategyset2
  totalresources2 farmnumber lumbermillnumber forgenumber farmnumber2 lumbermillnumber2 forgenumber2 enabletrade
  lowresource lowresource2 highresource highresource2 goldmax goldmax2 foodmax foodmax2 woodmax woodmax2 madmax
  enabletrade2 boatnumber2 finishpatch finishpatch2 done done2 hasdock hasdock2
  
  constructioncolor havebarracks barrackspatch templepatch swordsmannumber armylocationx
  armylocationy armymove armynumber havedock dockpatch boatnumber boatmove armydest boatdest 
  gowest goeast boatlocationx boatlocationy newdest walllocationx walllocationy]
turtles-own[goinghomegold goinghomeberry goinghomewood goinghomebuild resources alsoplayer maxresourcelevel cargo cargofull startedboat]
patches-own[resourcetotal resourcelevel iswall player isborder]
breed [miners miner] 
breed [woodcutters woodcutter]
breed [farmers farmer]
breed [builders builder]
breed [swordsmen swordsman]
breed [transportships transportship]

to go ;; this checks with all of the workers and figures out what they should do. It then runs the appropriate strategies, 
      ;; and checks to see if either civilization has collected all available resources
  
    ask miners with [alsoplayer = 1]
    [
        ifelse foundgold = 1 or goinghomegold = 1
        [gomine]
        [moveminers]
    ]
    ask woodcutters with [alsoplayer = 1]
    [
        ifelse foundwood = 1 or goinghomewood = 1
        [gochop]
        [movewoodcutters]
    ]
    ask farmers with [alsoplayer = 1]
    [
        ifelse foundberry = 1 or goinghomeberry = 1
        [gofarm]
        [movefarmers]
    ]
    ask miners with [alsoplayer = 2]
    [
      ifelse foundgold2 = 1 or goinghomegold = 1
        [gomine]
        [moveminers]
    ]
    ask woodcutters with [alsoplayer = 2]
    [
      ifelse foundwood2 = 1 or goinghomewood = 1
        [gochop]
        [movewoodcutters]
    ]
    ask farmers with [alsoplayer = 2]
    [
      ifelse foundberry2 = 1 or goinghomeberry = 1
        [gofarm]
        [movefarmers]
    ]
    ifelse strategyset = 1
    [
      runstrategy 1 strategy
    ]
    [
      setrunstrategy 1 strategy
    ]
    ifelse strategyset2 = 1
    [
      runstrategy 2 strategy2
    ]
    [
      setrunstrategy 2 strategy2
    ]
    checkend
  tick
end 

to changemax [pickplayer typeworker] ;; this changes the maximum amount of resources a worker can collect at one time, which is a result
                                     ;; of creating a building that corresponds to that type of worker
                                     
  (cf:cond
    cf:case [typeworker = "farmers"] [
      ask farmers with [alsoplayer = pickplayer]
      [
        if pickplayer = 1
        [
          set maxresourcelevel foodmax
        ]
        if pickplayer = 2
        [
          set maxresourcelevel foodmax2
        ]
      ]
      ]
     cf:case [typeworker = "woodcutters"] [
      ask woodcutters with [alsoplayer = pickplayer]
      [
        if pickplayer = 1
        [
          set maxresourcelevel woodmax
        ]
        if pickplayer = 2
        [
          set maxresourcelevel woodmax2
        ]
      ]
      ]
      cf:case [typeworker = "miners"] [
      ask miners with [alsoplayer = pickplayer]
      [
        if pickplayer = 1
        [
          set maxresourcelevel goldmax
        ]
        if pickplayer = 2
        [
          set maxresourcelevel goldmax2
        ]
      ]
      ])
end 

to comprun [buildtype curplayer] ;; this checks what is supposed to be built, and if it't not a dock, it changes the maximum
                                 ;; amount of resources that the corresponding workers can collect at one time
  (cf:cond
    cf:case [buildtype = "farm"][genericbuild 125 curplayer 300 wood
      if curplayer = 1
      [
        set foodmax (foodmax + 10)
      ]
       if curplayer = 2
      [
        set foodmax2 (foodmax2 + 10)
      ]
      changemax curplayer "farmers"]
    cf:case [buildtype = "lumbermill"][genericbuild 85 curplayer 300 wood
      if curplayer = 1
      [
        set woodmax (woodmax + 10)
      ]
       if curplayer = 2
      [
        set woodmax2 (woodmax2 + 10)
      ]
      changemax curplayer "woodcutters"]
    cf:case [buildtype = "forge"][genericbuild 25 curplayer 300 wood
      if curplayer = 1
      [
        set goldmax (goldmax + 10)
      ]
       if curplayer = 2
      [
        set goldmax2 (goldmax2 + 10)
      ]
      changemax curplayer "miners"]
    cf:case [buildtype = "dock"][genericbuilddock 36 curplayer 800 gold
      ])
end 

to increasefood [whichplayer amt] ;; this increases the total food, and increases total resources if it is a positive gain
  
  if whichplayer = 1
  [
   set food (food + amt)
   if amt > 0
   [
     set totalresources (totalresources + amt)
   ]
  ]
  if whichplayer = 2
  [
   set food2 (food2 + amt)
   if amt > 0
   [
     set totalresources2 (totalresources2 + amt)
   ]
  ]
end 

to increasewood [whichplayer amt] ;; this increases the total wood, and increases total resources if it is a positive gain
  
  if whichplayer = 1
  [
   set wood (wood + amt)
   if amt > 0
   [
     set totalresources (totalresources + amt)
   ]
  ]
  if whichplayer = 2
  [
   set wood2 (wood2 + amt)
   if amt > 0
   [
     set totalresources2 (totalresources2 + amt)
   ]
  ]
end 

to increasegold [whichplayer amt] ;; this increases the total gold, and increases total resources if it is a positive gain
  
  if whichplayer = 1
  [
   set gold (gold + amt)
   if amt > 0
   [
     set totalresources (totalresources + amt)
   ]
  ]
  if whichplayer = 2
  [
   set gold2 (gold2 + amt)
   if amt > 0
   [
     set totalresources2 (totalresources2 + amt)
   ]
  ]
end 

to checkend ;; this checks to see if a civilization has collected all available resources
  
  if (count patches with [pcolor = 44 and player = 1] + count patches with [pcolor = 52 and player = 1] + count patches with [pcolor = 13 and player = 1] = 0)
  [
    ask finishpatch
    [
      set pcolor green
      ask neighbors
      [
       set pcolor green 
      ]
      set done 1
    ]
  ]
  if (count patches with [pcolor = 44 and player = 2] + count patches with [pcolor = 52 and player = 2] + count patches with [pcolor = 13 and player = 2] = 0)
  [
    ask finishpatch2
    [
      set pcolor green
      ask neighbors
      [
       set pcolor green 
      ]
      set done2 1
    ]
  ]
end 

There are 5 versions of this model.

Uploaded by When Description Download
Gabriel Pezanoski-Cohen over 10 years ago this is the final version of my model, and it is absolutely perfect Download this version
Gabriel Pezanoski-Cohen over 10 years ago Added wall building and started working on creation of multiple islands, that part is a bit glitchy though Download this version
Gabriel Pezanoski-Cohen over 10 years ago Fixed swordsmen, added docks and boats Download this version
Gabriel Pezanoski-Cohen over 10 years ago fixed the swordsman creation, they still don't do anything yet though Download this version
Gabriel Pezanoski-Cohen over 10 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Civilization model.png preview Preview for 'Civilization model' over 10 years ago, by Gabriel Pezanoski-Cohen Download
Gabe Pezanoski-Cohen's Final Project.zip extension Zipped final project in case there's trouble downloading it over 10 years ago, by Gabriel Pezanoski-Cohen Download
GabePezanoski-Cohen_June1V3.docx word Progress Report for June 1st over 10 years ago, by Gabriel Pezanoski-Cohen Download
GabePezanoski-Cohen_May25V2.docx word Progress Report for May 25th over 10 years ago, by Gabriel Pezanoski-Cohen Download
GabePezanoskiCohen_May18_V1.docx word Progress Report for May 18th over 10 years ago, by Gabriel Pezanoski-Cohen Download
GabrielPezanoski-CohenFinalReport.pdf pdf Final Report over 10 years ago, by Gabriel Pezanoski-Cohen Download
myposter.pdf pdf My poster over 10 years ago, by Gabriel Pezanoski-Cohen Download
Pezanoski-Cohen_Gabe_Slam.pptx powerpoint Poster Slam slides over 10 years ago, by Gabriel Pezanoski-Cohen Download
ProjectProposal.pdf pdf Project Proposal over 10 years ago, by Gabriel Pezanoski-Cohen Download

This model does not have any ancestors.

This model does not have any descendants.