This page presents you with two kinds of assignments: submitted and unsubmitted. You are expected to prepare unsubmitted assignments for timely discussion. (Your active participation in our discussion list is part of your grade.) Submitted assignments are due at the end of the week for which they are assigned. Submitted assignments are graded; to receive credit must be submitted on time.
Related readings:
Related readings:
Related readings:
Go to the NetLogo dictionary. http://ccl.northwestern.edu/netlogo/docs/dictionary.html Look up let. Start NetLogo. Enter each of the following lines in the Command Center, in the order presented. (Some of these commands will not execute successfully.)
print 2+2 print 2 + 2 let x -2 show x let x -2 print x let x -2 print -x let x -2 print - x let x -2 print (- x)
Summarize your “lessons learned”.
Go to the NetLogo dictionary. http://ccl.northwestern.edu/netlogo/docs/dictionary.html Look up set. What is the difference between let and set?
Go to the NetLogo dictionary. http://ccl.northwestern.edu/netlogo/docs/dictionary.html Look up repeat. Then enter the following in the Command Center:
let x 0 repeat 50 [set x (x + 1)] show x
What result do you expect to see? Why? (Be detailed.)
Put the following in the Code tab:
globals [ x ]
Switch back to the Interface tab and enter the following (on three separate lines).
print x repeat 50 [set x (x + 1)] show x
Summarize what you have learned about global variables.
Answer Sketch
At the Command Center, enter the following lines. In each case, if what you see differs from what you expected, explain why.
show n-values 10 [random-float 1] show n-values 10 [random 1] show n-values 10 [random 2] random-seed 314 show n-values 10 [one-of [0 1]] random-seed 314 show n-values 10 [one-of [0 1]]
What do you notice about the last two lists you produced. Can you explain it?
Answer Sketch
turtles-own [wealth] to setup clear-all ask patches [sprout 1] ask turtles [set color one-of [red white blue]] ask turtles [set wealth random-float 100] end to go let %n (0.8 + random-float 0.4) ask turtles [set wealth %n * wealth] ask turtles [if wealth < 50 [die]] end
Produce a list of all patches in random order. Produce a list of all patches in a fixed order.
Given: a list of 2-element lists (pairs), such as [[1 2] [3 4] [5 6]]. Produce a string consisting of the first element of each pair, separated by a comma. (E.g., "1,3,5".)
Comment: such a string would be suitable for a CSV file.
Hint: use reduce, word, map, and first.
Suppose NetLogo did not have the one-of primitive. Devise a way to pick a random agent from an agentset.
Hint: first produce a list of the agents in the agentset.
Suppose you represent a bag of items by a list of objects (e.g., ["a" "b" "c"]) and a correspoding list of thei multiplicities (e.g., [ 1 2 3 ]). Show how to produce a list where each object occurs with its multiplicity (e.g., ["a" "b" "b" "c" "c" "c"]).
Hint: you can use n-values inside foreach, but be aware that you cannot then refer back to the foreach arguments with the question-mark notation.
Given an array a containing 5 zeros, what is the result of foreach n-values 5 [ ? ] [ array:set a ? ? * ? ]. Explain.
Answer Sketch
The result is { { array: 0 1 4 9 16 } }. We use n-values to create a list: http://ccl.northwestern.edu/netlogo/docs/dictionary.html#n-values In n-values 5 [ ? ] the ? stands for successive whole numbers, so the result is a list, [0 1 2 3 4]. So the code above turns into foreach [0 1 2 3 4] [ array:set a ? ? * ? ] (You can iterate over a list using foreach: http://ccl.northwestern.edu/netlogo/docs/dictionary.html#foreach) Now we ask anew what the ? stands for, and the answer is, that it successively stands for the elements of the list [0 1 2 3 4]. So NetLogo will first do array:set a 0 0 * 0, which sets the element at index 0` to the value ``0 * 0. And so forth.
Create a new NetLogo file, named coinflip01.nlogo.
In the Code window, use the globals primitive to introduce two new global variables: n-heads and n-tails. Then add a flip-coin procedure that uses ifelse and random-float to simulate the flip of a fair coin. Add one to n-heads if random-float 1 < 0.5 and otherwise add one to n-tails.
Go to the Command Center and use repeat to run your flip-coin procedure one hundred times. View the result by entering show n-heads and show n-tails. Did you get 50 heads and 50 tails? Should you have?
A typical NetLogo program will declare global variables, have a procedure named setup that does the preliminary model set up, and have a procedure named go that contains the schedule for one iteration of the model. Return to the Code window and add setup and go procedures to produce a complete a coin-flipping program. The setup procedure need only execute clear-all. Use the following go procedure:
to go set n-heads 0 set n-tails 0 repeat 50 [ flip-coin ] end
Return to the Command Center and run your setup procedure, then run your go procedure. Did you get the expected number of heads and tails? Run your go procedure again (without running setup). What is the outcome?
To the Interface window, add a button named Setup that runs the command setup. (To add a button, you can right click on the Interface window, where you wish to place the button.) Next add a button named Go Once that runs the command go. Next add a button named Go 100 that runs the go command 100 times. Test your buttons.
In the Code tab, append the update-plots command to your go procedure. To the Interface window, add a plot with the pen update command plot n-heads. Click your Setup and Go 100 buttons. Discuss the resulting plot.
What happens if you click the Setup button once and then the Go 100 button two times in a row?
Answer Sketch
globals [ n-heads n-tails ] to setup clear-all end to go set n-heads 0 set n-tails 0 repeat 50 [ flip-coin ] update-plots end to flip-coin ifelse (random-float 1 < 0.5) [ set n-heads (n-heads + 1) ] [ set n-tails (n-tails + 1) ] end
Answer Sketch
patches-own [ n-heads n-tails ] to setup clear-all end to go ask patch 0 0 [ set n-heads 0 set n-tails 0 repeat n-flips [ flip-coin ] set plabel n-heads ] update-plots end to flip-coin ifelse (random-float 1 < 0.5) [set n-heads (n-heads + 1)] [set n-tails (n-tails + 1)] end
First, make sure you have saved your file coinflip02.nlogo from Part II. Next, copy this to coinflip03.nlogo, a new NetLogo file. We are going to make some changes in this new file.
For the previous program, we only made use of one patch. This time, we will use one patch for each coin flip. So add the following to your setup procedure:
resize-world 0 0 0 (n-flips - 1) set-patch-size (400 / n-flips)
Read about resize-world and set-patch-size in the NetLogo Dictionary, and then explain in detail what this code does. Test this code by running your setup procedure.
Delete the patches-own statement from your Code window. Introduce a global variable named n-heads.
Next we introduce a little memory. In your setup procedure, intialize the global variable n-heads to an empty list.
Each patch will flip a coin and change its color to green for a head and to red for a tail. So replace the body of your flip-coin procedure with
ifelse (random-float 1 < 0.5) [set pcolor green] [set pcolor red]
Replace the body of your go procedure. It should now
Change your plot so that it plots the last number appended to n-heads. To the same chart, add a plot pen that plots the mean of n-heads.
Add a slider taking values from 0 to 1 (with an increment of 0.01), with a default value of 0.5, for a new global variable named p-head. This will be the probability of getting a head from a single coin flip. Change your flip-coin procedure to use p-head.
Experiment with your NetLogo program. Explain what your plot illustrates.
Implement the Mushroom Hunt, following the details provided in Chapter 2 of Railsback and Grimm (2011). (Be sure to fully comment your program.)
Change the body of your setup procedure to:
ca setup-globals setup-patches setup-turtles reset-ticks
(Comment: this is a rather typical setup procedure. Comment: order matters; set up in this order.) Create appropriate setup-globals, setup-patches, and setup-turtles procedures. We will add to these.
Introduce new globals, growback-time, max-energy, min-energy, and max-speed. Your setup-globals procedure should initialize these to 100, 10, 0.4, and 1.
Add a harvest-time attribute to patches. (This is automatically initialized to 0.) Give turtles an energy and metabolism attributes, initialized (in setup-turtles) to 1 and 0.001.
Introduce a new global variable n-hunters in a slider. Let the number vary from 1 to 10 but have a default of 2, and use this variable to determine how many hunters you create in your setup-turtles procedure. (Comment: when you create a global variable with a slider, you do not also declare it in your declarations section.)
Each tick, check the yellow patches to see if growback-time has passed since their harvest-time. If it has, turn the patch red again.
Constrain hunters' search speed to max-speed.
Each tick, after hunters search, deduct metabolism from each hunters energy, but constrain the minimum energy to be min-energy. Scale the turtle’s color to its energy. http://ccl.northwestern.edu/netlogo/docs/dictionary.html#scale-color
Each time a mushroom is harvested, set the patch’s harvest-time to the ticks value. Also, add 1 to the hunter’s energy, but then constrain energy not to exceed max-energy.
Every 100 ticks, clear the traces made by your hunters http://ccl.northwestern.edu/netlogo/docs/dictionary.html#mod http://ccl.northwestern.edu/netlogo/docs/dictionary.html#clear-drawing
Add a plot of the average energy of your hunters. http://ccl.northwestern.edu/netlogo/docs/dictionary.html#mean http://ccl.northwestern.edu/netlogo/docs/dictionary.html#of
When you run the simulation, if you want to be able to see the hunter behavior, you will probably need force it to go slower. Use the slider provided for this in the Interface tab.
It would be nice to ensure that when a user starts up your model, that the use is presented with your chosen default values for slider variables. However, the user will proceed as follows. 1. pick n-hunters using a slider, then 2. click the "SetUp" button to set up the model. If you set n-hunters in setup, you will override the user's choice.
However, NetLogo does provide a workaround for this: a special procedure named startup. Use this to initialize your user interface. http://ccl.northwestern.edu/netlogo/docs/dictionary.html#startup
Do things a little bit at a time. Do not try to do too much at once. Use the number one debugging suggestion: use lots of extra print statements so that you can see what is going on in your program. (In NetLogo programs you may use show instead of print, as it provides a bit more information.)
Answer Sketch
globals [ num-clusters growback-time max-speed max-energy min-energy ] patches-own [ harvest-time ] turtles-own [ time-since-last-found energy metabolism ] to startup ;; initialize slider set n-hunters 2 end to setup ;; typical setup proc ca setup-globals setup-patches setup-turtles reset-ticks end to setup-globals set num-clusters 4 set growback-time 100 set max-energy 10 set min-energy 0.4 set max-speed 1 end to setup-patches ;; ask patches [set harvest-time 0] ;; unneeded ask n-of num-clusters patches [ ask n-of 20 patches in-radius 5 [ set pcolor red ] ] end to setup-turtles crt n-hunters [ set energy 1 set metabolism 0.1 set size 2 set time-since-last-found 999 set color yellow pen-down ] end to go tick if (ticks mod 100 = 0) [ clear-drawing clear-plot ] ask patches with [pcolor = yellow] [ growback ] ask turtles [search] end to search ifelse time-since-last-found <= 20 [ right (random 181) - 90 ] [ right (random 21) - 10 ] fd min (list energy max-speed) set energy max (list min-energy (energy - metabolism)) ifelse (pcolor = red) [ set energy min (list max-energy (energy + 1)) set time-since-last-found 0 set harvest-time ticks set pcolor yellow ] [ set time-since-last-found (time-since-last-found + 1) ] set color scale-color yellow energy 0 max-energy end to growback if (ticks >= harvest-time + growback-time) [ set pcolor red ] end
Name the file for this part of the exercise ruin01.nlogo.
Make sure you code is fully commented. See the NetLogo Dictionary for help with the following: ticks, tick, plot, export-plot.
Name the file for this part of the exercise ruin02.nlogo. (This is a separate file from the 2-person model.)
Questions to consider:
This work goes in the same file as your previous work on the N-person model. (That is, just modify ruin02.nlogo.)
This goes in a separate file from the previous exercises. Name the file for this part of the exercise ruin03.nlogo.
Questions to consider:
Comment: an array location seems like a pretty shallow concept of an agent. It is actually a very common one in the literature. This assignment shows you how it can be simple and useful.
Do things a little bit at a time. Do not try to do too much at once. Use the number one debugging suggestion: use lots of extra print statements so that you can see what is going on in your program.
Let us see how you might approach the problem of writing a static-pairs-ruin procedure, step by step.
First, start with an empty procedure. This is sure to execute without a problem.
to static-pairs-ruin end
Next, make a list of the things you want to do, and take them up one at a time. Here they are:
Ok, let us take up the first one:
to static-pairs-ruin let %n 10 ; pretend we just have 10 wealths for testing show %n end
Check the syntax of your code. (In NetLogo, press the "Check" button in the Code tab.) It seems to be OK, so switch to the Interface tab and "run" your procedure. I.e., just entering its name into the command center.
Voila, it works! Of course we have a residual concern: you set %n to 10, regardless of the length of wealths. So make a note to yourself to figure out how to get the length of the wealths array. You can do this later.
to static-pairs-ruin ; let %n be the length of the `wealths` array let %n 10 ;; todo: get length of `wealths` show %n end
After (seriously, after) you have that working ok, then you add the next line.
to static-pairs-ruin ; let %n be the length of the `wealths` array let %n 10 ;; todo: need to get length of `wealths` ; let %pairs be the %n/2 static pairs returned by idxpairs01 let %pairs idxpairs01 %n show %pairs end
You have added a line, so press the "Check" button to check your code again. (Do this every time you add a line.) Ooops! It fails unless you copied my idxpairs01 proc into your Code tab. So copy it over, attribute it (right away!), and try again. That checks, so run it from the command center. Note that we again included a show command, so that you can examine the result. Does the result look like you expected? Make sure it does!! If it does, then you are ready to try to add another line to your proc.
But now we hit a barrier.
to static-pairs-ruin ; let %n be the length of the `wealths` array let %n 10 ;; todo: need to get length of `wealths` ; let %pairs be the %n/2 static pairs returned by idxpairs01 let %pairs idxpairs01 %n show %pairs ; for each pair, call ruin01 ; how to do this??? end
The problem is, although you suspect you should use the foreach command, you do not yet understand this command. So first you need to make sure you understand this command. So you go to http://ccl.northwestern.edu/netlogo/docs/dictionary.html#foreach and to https://subversion.american.edu/aisaac/notes/netlogo-intro.xhtml#agentsets-vs-lists and read about how to use foreach. You learn that ? is a special name that is sequentially assigned to each item in the foreach sequence. So you test that out:
to static-pairs-ruin ; let %n be the length of the `wealths` array let %n 10 ;; todo: need to get length of `wealths` ; let %pairs be the %n/2 static pairs returned by idxpairs01 let %pairs idxpairs01 %n ; for each pair, call ruin01 ; how to do this??? ; first, test use of ``foreach`` foreach %pairs [print ?] end
You use the Check button and find this is OK, so you again run your procedure from the command center and look at the output. Does it look like you expect? Make sure you can explain why you are seeing this output!
Now for your last step, you want to replace [print ?] with the code block that can take a pair, which is a list like [4 9], and execute [ruin01 4 9]. To do that, you should move to the command center and try a few things.
For example, at the Command Center you try
let test [4 9] ruin01 test
and you get
ERROR: RUIN01 expected 2 inputs.
Oh, of course: ruin01 needs two numbers. So you try
let test [4 9] ruin01 4 9
and that works, but ... how to get the list items from the list? Well, how about item!
let test [4 9] ruin01 item 0 test item 1 test
Hey, that works! Now you are ready to go back and used what you have learned to complete your procedure.
All four parts of this exercise are due as one NetLogo file. It is broken into parts for your convenience in implementing a model of increasing complexity.
Submit to me your fully commented code implementing all parts of the exercise as a single NetLogo file: template01.nlogo. (If anyone prefers to use Python or some other language, let me know.)
Plan! Use explicit comments to layout your program structure!
You will be graded on completeness of the assignment, correctness of the implementation, and adequacy (!!) of your comments.
Remember, you will not changing the display size of your agents. So, you cannot use "size" for the agents' size attribute, because that already has separate meaning in NetLogo. Use the name mysize instead.
Remember, there are four (4) parts to this assignment. Part I of the assignment is intended to have two challenging components.
There are many different ways to accomplish both parts.
Recall that we declare patch attributes with patches-own http://ccl.northwestern.edu/netlogo/docs/dictionary.html#patches-own
Recall that NetLogo implements uniform distributions through random-float: http://ccl.northwestern.edu/netlogo/docs/dictionary.html#random-float
NetLogo allows turtles to interact directly with patches. Your extract procedure can take advantage of this.
Remember that you can only construct a list with brackets if all the items are constants (e.g., numbers). If you are using variables, you need to use list: http://ccl.northwestern.edu/netlogo/docs/dictionary.html#list
A turtle can directly access the attributes of its patch. It does not have to access [pvar] of patch-here. Instead it can directly access pvar.
Use informative procedure names, and keep your procedures short and focused on doing one thing well.
By now, you certainly should have implemented the following:
to setup clear-all setup-globals setup-patches setup-agents reset-ticks end
We begin with a brief exercise (with no corresponding code).
Set up your simulation from part III.
Right click an patch 0 0. Note that the resulting GUI monitor reports your new patch attribute (supply). Note the patch coordinates, and close the monitor. Now enter (in the command center in observer context): inspect patch 0 0.
Right click on a turtle and inspect it. Note that the resulting GUI monitor reports your new turtle attribute (max-extract). Note the turtle's who number, and close the monitor. Now enter (in the command center in observer context): inspect turtle num where num is your turtle's who number.
Right click on a patch and inspect it. Note that the resulting GUI monitor reports your new patch attribute (supply). Note the patch's pxcor and pycor, and close the monitor. Now enter (in the command center in observer context): inspect patch px py where px py is your patch's pxcor and pycor.
Next we will make a permanent change in the GUI interface for your model. Facilitate user setting of two model parameters by adding a slider for each of
Next, add buttons in the GUI to set up and run the simulation, where set up includes the creation of agents.
Finally, add a stopping condition. You want to terminate iterations based on model state. Stop when any agent reaches mysize >= 100. (See the NetLogo stop command.)
You have a global variable, agent_max_extract. The instructions say:
an agent has a maximum extraction rate (equal to agent_max_extract)
So you also need to an a turtle attribute, max-extract, that you set equal to the global agent_max_extract during setup-turtles.
During Part III, you declare agent_max_extract in globals. In Part IV you move it to a slider, so you need to comment it out in your globals declaration (as we've discussed in past classes). A slider also declares a global variable, and you can only declare the variable once.
Before you begin, copy your “first approach” to a new file. (E.g., tm2.nlogo.) Don't change your first file any more.
In your tm2.nlogo file, change the model slightly: each iteration, sort agents by their “size” (i.e., their mysize attribute) to determine the move order: a larger “size” implies an earlier move.
Optimization: each agent moves to a best available neighboring cell.
This is probably the hardest thing you have done yet.
We now add entry and exit of agents.
Let's add to your model two graphs: a time-series plot of the Gini, and a dynamic Lorenz curve (of mysize).
Your code should be heavily commented.
Additionally, you should also add a time-series plot that displays the evolution of a new model statistic over time: the number of agents alive at each iteration.
Additionally, I would like you to do a simple randomization of the initial model state, as follows.
Assign each initial agent a random size during the model set up. (Do not apply this to any offspring.)
- each initial size is drawn independently from a normal distribution
- mean and standard deviation of the size distribution are model parameters
- if the size draw is less than 0.0, it is set to 0.0
Copy tm2.nlogo to tm3.nlogo. Do not change tm2.nlogo any more.
Change the topology so that it no longer wraps. And change the grid size to 251 (x values of 0 to 250) by 113 (y values from 0 to 112). As usual, svn add this file in your personal folder.
Next, find the celldata.txt file in the folder that holds your personal folder. You do not need to add it to the repository; it is already in the repository. The file format is plain text: look at it (!!) with a text editor. You will read in the given file of cell data to initialize your model.
Here is how change your model code.
Setup
Change in display:
Create a folder below your homework folder called output.
Each iteration, compute some summary statistics for the model and write model summary to the file "output/myoutput.csv".
Be sure to open, append to, and close the output file each iteration.
After you are done, open the file in a text editor to view its contents. Then, open the file in a spreadsheet and graph your three series. (If you are not familiar with any spreadsheets, the SSRL can help you with Excel.)
Color your hunters yellow and give them a classic arrowhead shape.
Pick a random turtle and a random one of its links, and replace it within one attached preferentially
- Higher chance of linking to a turtle with the most links
Go to Model Library, open Network > Preferential Attachment, and save under a new name
- Agentset – a list set of agents
- Defaults to a random order but can be sorted
- Can also pick a random agent from the list
- If we want angentset to persist, must set it to a name we have previously declared in globals or locally
- If we have picked a turtle, other turtles is an agentset of all of the other turtles
Bowen’s suggested modifications of Life * add a slider for global variable init-number
- default = 2
- possible values from 1 to 5
- handle divide-by-zero error when running with init-links = 1
- Divide by clustering-coefficient-of-lattice . divide by dum, protect dum from being zero
- We might eventually want a better fix
We will have the agents interact by playing a simple two-player game. We will combine this two-player game with of learning. Here agents will learn what strategy to use when playing the game.
Implement this game
Write a Netlogo simulation in which agents play a simple two-player game like the Prisoner’s Dilemma. Each agent plays the game using some strategy (by “strategy” I mean something like Tit-for-tat) and initially each agent randomly selects which strategy to use. After that, the game proceeds in rounds. On each round every agent is paired up with exactly one other agent, and the agents play the game. Depending on how both agents play — and on the game that they play — each agent gets a score. Agents total up their scores over time.
After some number of rounds, agents make a decision about whether to change strategy.
Things your simulation must do:
1. The simulation must include at least two games, one of which is the Prisoner’s Dilemma (for the other, you can use any of the games that we talked about in class, or any two-player game that you care to invent).
3. The simulation must include some decision making about which strategy to use and this should be based on the scores that different agents obtain through playing their strategy.
4. The simulation must update on ticks (see the Netlogo manual to get a full explanation of this), and it must display a count of the total number of ticks that have elapsed in a simulation.
You can do everything with patches, but it is also fine to use turtles.
Document
All you are going to hand in is the Netlogo program so make sure you:
2. Write a description of your program in the Information tab. Here you should write an overview of the problem, the strategies for playing the game, and the ways in which agents make their decision about which strategy to use.
Experiment
Once your simulation is complete, experiment with different initial proportions of strategies, and different games, seeing whether the agents all converge on the same strategy and if they do how many ticks it takes. Since there is randomness in the simulation, you’ll need to do several runs (say 10) of each combination in order to get a reliable idea of how they perform.
Describe the results of your experiments, including the statistics you collect, in the Information pages of your project.
Hand it in
Save your model as <my-name>-pd.nlogo, where you replace <my-name> with your own name (so my program would be called parsons-pd.nlogo) and email it to the TA.
The subject line of your email should say: LastName Econ 396/696: PD Project
If you don’t get an acknowledgement within 24 hours, send me a follow-up email.
Carefully describe (in words) the essential structural features of the Schelling (1978) segregation model (hereafter referred to as the Schelling Model), as set out by [schelling-1978ch4-mm] on pages 147-155. (You may rely on my notes or read that chapter.)
Does the Schelling Model in the NetLogo Models Library capture the general structural features of the Schelling Model? (What is included; what is missing; what if anything is an extension?)
Construct an activty diagram (i.e., flow chart) for the Schelling model. (You can use any drawing program you like, but you may want to use Dia for this.)
What parameter values must be specified by the user before “experiments” can be run?
Based on your reading and on your preliminary observations of the demo, propose two different quantitative measures of segregation. Justify your proposals.
Create an experimental design, carefully following our discussion of experimental design. (Example: explore how your final measure(s) of segregation are affected by changes in one or more model parameters.)
Run your experiments and report your results, carefully following our discussion of results reporting.
Summarize your results. Do they support your hypotheses? Comment on the compatability of your proposed segregation measures: do they produce similar or divergent results? Do either or both of your proposed measures have any advantages or drawbacks? (Does either appear more useful than the other?)
Propose some possible extensions to the Schelling model. (Be clear about what applications you have in mind.) You do not have to implement these extensions.
See the NetLogo Models Library for a simple version of the Segregation model.
Cook, Christopher, “Home Page for the Schelling Segregation Model: Demonstration Software” http://www.econ.iastate.edu/tesfatsi/demos/schelling/schellhp.htm
Tesfatsion, Leigh, “Experimental Design: Basic Concepts and Terminology” http://www.econ.iastate.edu/classes/econ308/tesfatsion/ExpDesign.pdf
Thomas C. Schelling, Micromotives and Macrobehavior, W. W. Norton & Company, New York, 1978, Chapter 4 (“Sorting and Mixing: Race and Sex”), pages 137-155
Based on: http://mcbridme.sba.muohio.edu/ace/labs/lab/assets/ZITraderLab.pdf
develop flow diagrams for the ZIT Gode-Sunder computational model
Consider a ZIT implementation, such as the McBride (2008) online demo ZI Trading NetLogo Model: http://mcbridme.sba.muohio.edu/ace/labs/zitrade/zitradenetlogo.html McBride implements the zero-intelligence constrained (ZI-C) traders from Gode and Sunder: the ZI-C traders are constrained not to make any trade that will yield a negative profit. McBride sets the following defaults:
does the McBride ZI Trading demo for ZI-C trading correctly implement the Gode-Sunder experiments? (With ZI-C traders.)
Complete 5 runs of the ZI-C simulation with McBride’s default parameter values, setting T=2000.
For each run:
Experiment: increase the number of sellers to 100
Record your initial initial simulation results in a table like the following. Make a similar table after changing the number of sellers.
Obs Price Qty Vol Avg-Price Std-Dev Efficiency 1 2 3 4 5
Your write up should consider the following questions: