Вы находитесь на странице: 1из 6

WILHITE NETLOGO TEXT WHAT IS IT?

This model implements bilateral exchange in small world networks based on the model described by Wilhite (2001). Wilhite studied the impact of network formation on key elements of the trade process: search, negotiation, and exchange. In particular, he focused on the implication of small world networks on trade. In a small world network, an agent is only a few connections away from any other agent. Small world networks were popularized in the game "six degrees of Kevin Bacon" where participants try to link any one actor/actress to another actor/actress through other actors/actresses that they have shared a movie with (ending with Kevin Bacon). HOW IT WORKS This model is an adaptation of a model developed by Allen Wilhite (2001). In Wilhite's model, 500 agents are placed in one of four network structures (described below). Each agent is given a random endowment of each of two goods. Good 1 can only be held and traded in integer units while good two is perfectly divisible. Each agent has a Cobb-Douglas utility function dependent on the two goods and all trades must satisfy their budget constraint. Prices are specified in terms of amount of good 2 paid for a unit of good 1. In each round of the model, every agent (in random order) is given the opportunity to search among all agents to which he has a network connection to find the best agent to trade with. The pair of agents then trade using bilateral exchange until further trade would not improve both agent's welfare. Rounds of trading continue until a round occurs with no trades. The four network structures Wilhite implements are: global: All agents are connected to every other agents. Thus each agent is able to trade with every other agent. locally disconnected: The agents are split into distinct groups. Agents are connected only to other agents in their group. Thus each agent can only trade with agents in their group and no trade takes place across groups. locally connected: The agents are split into distinct groups as in the locally disconnected network. The groups are then arranged in a circle and each group overlaps its neighboring groups by sharing one member. Thus every group has two agents who are common to different adjacent groups. The common agents can trade with members of either group while the rest of the members of a group can only trade within the group. small world: The agents are formed into a locally connected network. Then a small number of agents are randomly selected to connect with agents in other groups. There are two restrictions on these crossover connections. First, a crossover agent cannot be one of the common traders shared between adjacent groups. Second, the new connection cannot connect two groups who already have a common agent. This model implements the major features of Wilhite's model. The number of agents is smaller due to limitations in clearly graphing the alternative network structures. In addition, this model allows you to specify experiments with alternative values for key parameters: number of agents, number of groups, number of crossover agents, and the maximum endowment that can be randomly set for each good for each agent. HOW TO USE IT To run the model, select the number of agents, the number of groups, the maximum amount of endowment per good per agent, the type of network, and the number of cross over agents. Next press the setup button to initialize the model. The network is drawn on the landscape and the links between agents are shown. The agents do not move around or use the landscape in any significant way. Click the

highlight button and then hover the mouse over an agent. All agents in the same trading group (given the network specified) are highlighted. Press the highlight button a second time to turn it off. The go button starts the simulation. The model graphs the average prices each round (tick of the simulation) for each group. The monitors are updated. The model will end automatically when the convergence criteria is met (a round with no trades). Here's a more complete description of each interface element: Buttons: go: starts the model running setup: clears out any previous runs, initializes all variables, and creates the specified network for the number of agents and groups. reset: resets all sliders to their default values highlight: when clicked allows you to hover over an agent in the landscape and see all agents linked to the selected agent. The model will not run until the highlight button is not selected. Sliders: num-agents: number of agents in network ranging from 10 to 100 num-groups: number of groups to split the agents into ranging from 10 to 200 endowment-per-good-agent: maximum value an agent may have for each good ranging from 1000 to 10000. Actual endowments of the two goods is randomly determined for each agent between 10 and endowment-per-good-agent. num-crossovers: number of crossover agents in small world network ranging from 1 to 5. Value is ignored for all other network models. Note that if value is >= number of groups then not all crossovers may be created. network: type of network to form: global, locally disconnected, locally connected, and small world. Graphs: Average Price: Displays the average prices of each group per round (tick) of trading. Monitors: total-g1: total endowment of good 1 held by all agents total-g2: total endowment of good 2 held by all agents predicted price: predicted equilibrium price given total endowments of good 1 and good 2 searches: total number of searches conducted by agents to find trading trading partners total trades: total trades undertaken between pairs of agents rounds: number of rounds completed (a complete round means each agent had the opportunity, in random order, to find a trade partner. current trades: number of trades in the current round global average price: average of all prices paid in the current round by agents who traded global std dev: standard deviation of all prices paid in the current round by agents who traded cc: clustering coefficient of network apl: average path length of network. If 9999 means network is disconnected THINGS TO NOTICE For a given number of agents and a given network structure, how closely did global prices converge to the predicted price? How much dispersion occurred in the prices? How many rounds did it take for the model to converge (no more trades)? Was there significant differences in the number of searches, total trades, and number of rounds for the model to converge for the different network structures? How do the different network structures affect the clustering coefficient (cc) and the average path length (apl)? How do cc and apl vary with the number of crossover agents in the small world network? THINGS TO TRY Using behavior space in Netlogo, re-run Wilhite's experimental design (pp. 55-56, Table 1) for 50 agents; for 100. Did you get the relative results? What might be leading to the differences?

Using behavior space in Netlogo, design and run an experiment to test if the maximum endowment per good per agent affects the speed of convergence. EXTENDING THE MODEL Change the convergence criteria of the model. Design additional hypotheses for the model. Implement an experimental design to test the hypotheses using behavior space in Netlogo. Implement an alternative network structure: giant components, directed networks, or preferential networks. RELATED MODELS See the Small World model in the Networks section of the Models Library which provides an excellent overview of small world models, additional resources about small world models, and further explanation of the network concepts of clustering coefficients and average path length. REFERENCES Allen Wilhite. 2001. Bilateral Trade and 'Small-World' Networks. Computational Economics. 18 (August)1: 49-64. Leigh Tesfatsion has very good summary notes on Wilhite's model. See http://www.econ.iastate.edu/classes/econ308/tesfatsion/WilhiteNotes.LT.pdf (pdf,236K). ONLINE/CLASS PRESENTATION. NOTE: These presentation slides summarize key points from the article by Wilhite (2001), linked here. http://www.econ.iastate.edu/tesfatsi/SmallWorldNetworksBilateralTrade.Wilhite.pdf, "Bilateral Trade and `Small-World' Networks" (pdf,181K), Computational Economics, Vol. 18, No. 1, August, pp. 49-64. CREDITS Developed by: Mark E. McBride Department of Economics Miami University Oxford, OH 45056 mark.mcbride@muohio.edu http://mcbridme.sba.muohio.edu/ Last updated: December 13, 2008

WHAT IS IT? This model explores the formation of networks that result in the "small world" phenomenon -- the idea that a person is only a couple of connections away any other person in the world. A popular example of the small world phenomenon is the network formed by actors appearing in the same movie (e.g. the "six degrees of Kevin Bacon" game), but small worlds are not limited to peopleonly networks. Other examples range from power grids to the neural networks of worms. This model illustrates some general, theoretical conditions under which small world networks between people or things might occur. HOW IT WORKS This model is an adaptation of a model proposed by Duncan Watts and Steve Strogatz (1998). It begins with a network where each person (or "node") is connected to his or her two neighbors on either side. The REWIRE-ONE button picks a random connection (or "edge") and rewires it. By rewiring, we mean changing one end of a connected pair of nodes, and keeping the other end the same. The REWIRE-ALL button creates the network and then visits all edges and tries to rewire them. The REWIRING-PROBABILITY slider determines the probability that an edge will get rewired. Running REWIRE-ALL at multiple probabilities produces a range of possible networks with varying average path lengths and clustering coefficients. To identify small worlds, the "average path length" (abbreviated "apl") and "clustering coefficient" (abbreviated "cc") of the network are calculated and plotted after the REWIRE-ONE or REWIRE-ALL buttons are pressed. These two plots are separated because the x-axis is slightly different. The REWIREONE x-axis is the fraction of edges rewired so far, whereas the REWIRE-ALL x-axis is the probability of rewiring. Networks with short average path lengths and high clustering coefficients are considered small world networks. (Note: The plots for both the clustering coefficient and average path length are normalized by dividing by the values of the initial network. The monitors give the actual values.) Average Path Length: Average path length is calculated by finding the shortest path between all pairs of nodes, adding them up, and then dividing by the total number of pairs. This shows us, on average, the number of steps it takes to get from one member of the network to another. Clustering Coefficient: Another property of small world networks is that from one person's perspective it seems unlikely that they could be only a few steps away from anybody else in the world. This is because their friends more or less know all the same people they do. The clustering coefficient is a measure of this "all-my-friends-know-each-other" property. This is sometimes described as the friends of my friends are my friends. More precisely, the clustering coefficient of a node is the ratio of existing links connecting a node's neighbors to each other to the maximum possible number of such links. You can see this is if you press the HIGHLIGHT button and click a node, that will display all of the neighbors in blue and the edges connecting those neighbors in yellow. The more yellow links, the higher the clustering coefficient for the node you are examining (the one in pink) will be. The clustering coefficient for the entire network is the average of the clustering coefficients of all the nodes. A high clustering coefficient for a network is another indication of a small world. HOW TO USE IT The NUM-NODES slider controls the size of the network. Choose a size and press SETUP. Pressing the REWIRE-ONE button picks one edge at random, rewires it, and then plots the resulting network properties. The REWIRE-ONE button always rewires at least one edge (i.e., it ignores the REWIRING-PROBABILITY). Pressing the REWIRE-ALL button re-creates the initial network (each node connected to its two neighbors on each side for a total of four neighbors) and rewires all the edges with the current rewiring

probability, then plots the resulting network properties on the rewire-all plot. Changing the REWIRINGPROBABILITY slider changes the fraction of links rewired after each run. When you press HIGHLIGHT and then point to node in the view it color-codes the nodes and edges. The node itself turns pink. Its neighbors and the edges connecting the node to those neighbors turn blue. Edges connecting the neighbors of the node to each other turn yellow. The amount of yellow between neighbors can gives you an indication of the clustering coefficient for that node. The NODE-PROPERTIES monitor displays the average path length and clustering coefficient of the highlighted node only. The AVERAGE-PATH-LENGTH and CLUSTERING-COEFFICIENT monitors display the values for the entire network. THINGS TO NOTICE Note that for certain ranges of the fraction of nodes, the average path length decreases faster than the clustering coefficient. In fact, there is a range of values for which the average path length is much smaller than clustering coefficient. (Note that the values for average path length and clustering coefficient have been normalized, so that they are more directly comparable.) Networks in that range are considered small worlds. THINGS TO TRY Try plotting the values for different rewiring probabilities and observe the trends of the values for average path length and clustering coefficient. What is the relationship between rewiring probability and fraction of nodes? In other words, what is the relationship between the rewire-one plot and the rewire-all plot? Do the trends depend on the number of nodes in the network? Can you get a small world by repeatedly pressing REWIRE-ONE? Set NUM-NODES to 80 and then press SETUP. Go to BehaviorSpace and run the VARY-REWIRINGPROBABILITY experiment. Try running the experiment multiple times without clearing the plot (i.e., do not run SETUP again). What range of rewiring probabilities result in small world networks? EXTENDING THE MODEL Try to see if you can produce the same results if you start with a different initial network. Create new BehaviorSpace experiments to compare results. In a precursor to this model, Watts and Strogatz created an "alpha" model where the rewiring was not based on a global rewiring probability. Instead, the probability that a node got connected to another node depended on how many mutual connections the two nodes had. The extent to which mutual connections mattered was determined by the parameter "alpha." Create the "alpha" model and see if it also can result in small world formation. NETWORK CONCEPTS In this model we need to find the shortest paths between all pairs of nodes. This is accomplished through the use of a standard dynamic programming algorithm called the Floyd Warshall algorithm. You may have noticed that the model runs slowly for large number of nodes. That is because the time it takes for the Floyd Warshall algorithm (or other "all-pairs-shortest-path" algorithm) to run grows polynomially with the number of nodes. For more information on the Floyd Warshall algorithm please consult: http://en.wikipedia.org/wiki/Floyd-Warshall_algorithm NETLOGO FEATURES The various network/link features (introduced in NetLogo 4.0) are used extensively in this model. Lists are used heavily in the procedures that calculates shortest paths.

RELATED MODELS See other models in the Networks section of the Models Library, such as Giant Component and Preferential Attachment. CREDITS AND REFERENCES This model is adapted from: Duncan J. Watts, Six Degrees: The Science of a Connected Age (W.W. Norton & Company, New York, 2003), pages 83-100. The work described here was originally published in: DJ Watts and SH Strogatz. Collective dynamics of 'small-world' networks, Nature, 393:440-442 (1998) For more information please see Watts' website: http://smallworld.columbia.edu/index.html The small worlds idea was first made popular by Stanley Milgram's famous experiment (1967) which found that two random US citizens where on average connected by six acquaintances (giving rise to the popular "six degrees of separation" expression): Stanley Milgram. The Small World Problem, Psychology Today, 2: 60-67 (1967). This experiment was popularized into a game called "six degrees of Kevin Bacon" which you can find more information about here: http://www.cs.virginia.edu/oracle/ HOW TO CITE If you mention this model in an academic publication, we ask that you include these citations for the model itself and for the NetLogo software: - Wilensky, U. (2005). NetLogo Small Worlds model. http://ccl.northwestern.edu/netlogo/models/SmallWorlds. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. - Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. In other publications, please use: - Copyright 2005 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/SmallWorlds for terms of use. COPYRIGHT NOTICE Copyright 2005 Uri Wilensky. All rights reserved. Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed: a) this copyright notice is included. b) this model will not be redistributed for profit without permission from Uri Wilensky. Contact Uri Wilensky for appropriate licenses for redistribution for profit.

Вам также может понравиться