+ All Categories
Home > Documents > UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a...

UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a...

Date post: 09-Aug-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
35
Transcript
Page 1: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

UNIVERSITY OF TURIN

Degree course in Physics of Complex System

Econophysics Essay: study of economic

dynamics in a simple city model using

genetic algorithms

Student: Silvia Lazzardi

Academic year 2016-2017

Page 2: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2

Page 3: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

Contents

1 Introduction 51.1 ABMs and NetLogo . . . . . . . . . . . . . . . . . . . . . . . . 61.2 Genetic Algorithms and BehaviorSearch . . . . . . . . . . . . 7

2 The Model 92.1 Program's description . . . . . . . . . . . . . . . . . . . . . . . 9

2.1.1 The agents . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.2 Bank and business . . . . . . . . . . . . . . . . . . . . 102.1.3 Incomes administration by agents . . . . . . . . . . . . 112.1.4 Bank failure . . . . . . . . . . . . . . . . . . . . . . . . 11

2.2 Looking at the code . . . . . . . . . . . . . . . . . . . . . . . . 122.2.1 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.2 Go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Results and Conclusions 233.1 CrisisOn:

increasing retireCashProbability results . . . . . . . . . . . . . 233.1.1 Maximizing Fitness . . . . . . . . . . . . . . . . . . . . 233.1.2 Minimizing Fitness . . . . . . . . . . . . . . . . . . . . 24

3.2 CrisisO�: results . . . . . . . . . . . . . . . . . . . . . . . . . 283.3 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Bibliography 35

3

Page 4: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

4 CONTENTS

Page 5: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

Chapter 1

Introduction

Economy can be seen as a complex system, or rather as a system in motion,that perpetually constructs itself anew through the continuos interactionsamong system agents, whose behaviors suits situations changing accordingto a countless number of parameters.In real situations, it was proved (by the prisoner dilemma, for example) thatthe assumption that the outcome in collective system isn't simply the sumof the rational actions of the individuals, but it is often a non-intuitive resultat the macro-level, that emerges from simple interactions at the micro level.So, it is of interest for researchers to try to model and to study this complexsystem through modern computational languages.The idea of this experiment is to study the economic dynamics of a monop-olistic competition market modelled as a city populated by many agents andin which there is a bank. The agents, thanks to the bank and to their initialwealth and to their monthly salary, in every moment of simulation can openone of some di�erent commercial activities.Agents who do not own a business become clients, under di�erent conditions,of the shops.Like in a real monopolistic competition market, since there are no limits (ex-cept agents wealth) in opening a business, in the long run earnings decrease(as a consequence of the larger number of commercial activities of the sametype) and they can fail, impoverishing the bank, if it had invested in thosebusiness.It is also possible that a crisis hits the model, so that the bank can fail aswell.The main interest of this work is to �nd the ideal conditions, or rather, thevalues for the parameters appearing in the model such that the system is in aeconomic equilibrium or those for which the bank fails as quickly as possible.This was done using genetic algorithms.

5

Page 6: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

6 CHAPTER 1. INTRODUCTION

This essay is essentially organized in three parts:

1. the following: an introductory chapter to the means by which this workwas made;

2. a second part, the next chapter (Chapter 1), that describes how theprogram works and how the code is written;

3. and the last one (Chapter 3), that conteins the results of simulationsand �nal considerations.

1.1 ABMs and NetLogo

This idea was built using NetLogo (since 1999), a multi-agent programmablemodeling environment authored by Uri Wilensky and developed at the CCL.It is important to say something regarding the agent-based models (ABMs).These are one of a class of computational models for simulating the actionsand the interactions of autonomous agents (also of a group of agents, iden-ti�ed as a collectivity). Agent-based models are a kind of microscale modelthat simulate the simultaneous operations and interactions of multiple agentsin an attempt to re-create and predict the appearance of complex phenom-ena.Unlike other programming languages (like python, C++ etc.), they are char-acterized by a graphic window where is rappresented what is happening inthe wolrd. ABMs are useful in many research �elds studying complex sys-tems ranging from sociology, physics, biology, economy and so on.A �rst idea of agent-based modeling was developed in the late 1940s, whenVon Neumann conceived a theoretical machine capable of reproduction, fol-lowing precisely and detailed instructions. It followed the construction ofthe Game of Life, in 1970, by the British mathematician John Horton Con-way, performed in a virtual 2d world. However, since an ABM requirescomputation-intensive procedures, it did not become widespread until the1990s; when thanks to the appearance of StarLogo �rst, Swarm and NetLogolater, modelling software became widely available and the range of domainsthat ABM was applied to, grew up.

Netlogo was born from the separation of the group members of theolder Starlogo and was designed to be low threshold and no ceiling. It iscomposed by an interface (that is very important because many things, likethe dimentions of the world, can be setted only using the interface and notthrough the code) and by a shell for the code.

Page 7: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

1.2. GENETIC ALGORITHMS AND BEHAVIORSEARCH 7

The code is very simple to read, also because it was designed also for teach-ing children and for experts without a programming background to modelrelated phenomena. NetLogo is useful to explore emergent phenomena, mod-ifyng the interface elements, like sliders, buttons, switcher and so on.

1.2 Genetic Algorithms and BehaviorSearch

In the �eld of computer science a genetic algorithms (GA) is a metaheuristic1

inspired by the process of natural selection.In a GA a population of candidate solutions, called individuals, evolves inorder to optimize the problem: every indivial has a set of features each ofwhich is associated with a binary value (0 or 1). This binary strings of 0s and1s is called genotype. Every feature can be mutated in order to starting theevolution of the population. The evolution in an iterative process that usuallystarts from a population of randomly generated individuals. The populationin each iteration is called a generation. How the population evolve?Called �tness the value of the objective function that we want to optimize, itis evaluated in each individual of each generation. The more �t individualsare stochastically selected from the current population, and each individualgenome is modi�ed (recombined and possibly randomly mutated) to form anew generation. The new generation of candidate solutions is then used inthe next iteration of the algorithm. The algorithm terminates when either amaximum number of generations has been produced, or a satisfactory �tnesslevel has been reached for the population.To �nd the better parameters to analize this model we used BehaviorSearch,that is a software tool designed to help with automating the exploration ofagent-based models (ABMs) by using also genetic algorithms.

1A higher-level procedure designed to �nd, generate or select an algorithm used to solve

an optimization problem.

Page 8: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

8 CHAPTER 1. INTRODUCTION

Page 9: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

Chapter 2

The Model

2.1 Program's description

The city of this model has two neighborhoods populated by people generallymore or less well-out.Initially there are just a bank and a certein number of agents decided by theuser. A certein percentage of agents creates a link with the bank, opening abank account. These agents deposit there part of their initial wealth in thebank account.We assume that time is discrete. It is marked by ticks and every tick rapp-resents a day.

2.1.1 The agents

The agents are characterized by di�erent features:

• Economic initial situation, that depends from where the agents arecreated. The left of the city is basically richer than the right. Thestarting wealth of agents is setted with a random uniform distributionthat has clearly an highest roof for the left part. According to thisstarting wealth, every agent is classi�ed in one of these categories:

� well-o�;

� middle class;

� poor.

• Caracterial attitudes, that depend just on the stingy rate, decided bythe user, whereby is de�ned the percentage of stingy people. So anagent could be:

9

Page 10: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

10 CHAPTER 2. THE MODEL

� stingy or

� spendthrift.

Every month (30 ticks) the agents earn in base on their social position. Ifthey have a bank account, their income is put directly on their bank account,if not they take it on cash.If the agents are going to �nish their cash, they can retire part of their wealthstock from their bank account, if they have one. In the opposite case, theycan open a bank account and ask for a loan. The same is valid for an agentwho is going to �nish their wealth stock in the bankaccount.

2.1.2 Bank and business

The agents can, with a certein probability, put part or totally their wealthstock in a bank account and can ask (another time with a certein probability)the bank a loan to open a commercial activity.In this model there are four di�erent types of shops:

• Cafe;

• Normal clothes shops;

• Expensive clothes shops;

• Supermarkets.

An agent can open one of these shops with di�erent probabilities that canbe chosen from the user. If he has enough wealth stock he just pay with his�nances, if not he can ask bank for a loan. The bank needs guarantees togive loans, so the possibility to open a commercial activity depends on theincome held by the agent, as well as on the certein probability we mentionedbefore.Open di�erent shops has di�erent initial costs that, if all the conditions aresatis�ed, are sustained by the bank. The most expensive to open is the ex-pensive clothes shop and the cheapest is to open a cafe, so it is intuitive tothink that there are more cafes than expensive clothes shops (if the proba-bilities are the same) and that these last will be concentrated in the richerneighborhood.

Every month each business has to pay �xed costs, due to the rent of theroom etc. and a variabile cost, that depends on how much it sold.The shops can also fail if their wealth stock is under a certein threshold de-cided by the user. When it happens the agent that ran the shop returns to

Page 11: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2.1. PROGRAM'S DESCRIPTION 11

be a normal client with no cash and poor, so every month will receive theminimal salary. In order to stimulate his economic recovery he is stingy.So, in this simulation every moment the number of the di�erent types ofshops can change, in fact there will be new shops while others will fail !Another important point are the prices of goods. Since this is a monopolisticcompetition market, prices are not costant, but depend on the number ofcustomers and on the other shops of the same type. The price of a certeingood is created with the mechanism of the stock tickers sale.

2.1.3 Incomes administration by agents

The agents, that at this point became clients, can spend their incomes withdi�erent probabilities on di�erent shops and in base on their caracterial at-titudes. Every day clients move around the city, in order to help purchasesof di�erent types of clients in the shops.The ways to buy of the clients can be summarized in these point:

• the agents go tipically in the nearest cafe with a frequence that dependson the Bar pause probability (decided by the user). Here, clients cantake just a co�ee or a cappuccino and a pastrie with di�erent proba-bilities.

• As for normal clothes shops, the primary condition for an agent tobuy in one of that shops is to have wealth stock in a certein quantity(because to buy clothes is often not necessary). If it is veri�ed, thestingy clients buy clothes with a minor probability and in a much lessrandom number than spendthrift agents.

• The same is valid for the expensive clothes shops, with more stringentconditions for the stock wealth.

• Supermarkets, being necessary for the agents to eat and to drink, arefrequentated with a higher probability three times a month.

2.1.4 Bank failure

When a business fails, the bank, if it has supported �nancially that one, losesthat given wealth. So it happens that the bank loses part of agents wealthstock!However, the bank can go forward since it is assumed that no all agents willwithdraw their stock wealth at the same time.

Page 12: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

12 CHAPTER 2. THE MODEL

Figure 2.1: Interacting interface

When the bank deposits are on the verge of a certain threshold chosed bythe user (included between the 30% and the total of the starting deposits),the bank gives up yielding loans.If deposits drop below that threshold, the bank fails and the simulation isstopped. The failure of the bank can be induced turning on the crisis button:in this case the bank is intended to fail because many of its cliens withdrawtheir stock wealth at the same time.

2.2 Looking at the code

In the NetLogo program interface (see �g. 2.1) there are many sliders to besetted before or while the program is running, two switches and two buttons:setup and go, that we will see in details in this section, linking us with whatwe have seen in the previous section.Now let's see how the program is built.Going to see the code, �rst of all the di�erent breeds (clients and the com-mercial activities), globals (or rather variables valid for all the breeds) andbreeds-own (variables associated with that particular breed) are declared ascan be seen in �g. 2.2.

Page 13: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2.2. LOOKING AT THE CODE 13

Figure 2.2: globals and breeds

Figure 2.3: setup button commands

Page 14: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

14 CHAPTER 2. THE MODEL

2.2.1 Setup

The role of this button is to create the enviroment of our model's world (lookat �g. 2.3).

How does it work?

• In order to count days from the beginning of each new simulation, theglobal days is setted on 0 every time we push the setup button

• create-clients creates nClients and sets some of their feature. Ini-tially the agents haven't a bank account, they are grey and they arestingy or not with a probability equal to that setted in the slider stingy-ClientsRate

• create-banks creates one bank at the centre of our city and sincethere aren't bank accounts, it has no cash. Furthermore both globalssell and buy are setted false because the bank does not a�ect directlythe market.

• graph serves to place agents randomly and neatly in rows and columns

• de�neEconomicSituation avails to set the initial agents cash accord-ing to their x coordinate, splitting the world in two neighborhoods.

• open-bank-account, if a random number between 0 and 1 is underthe bankAccountThreshold, allows to put in a bank account the savingsof clients. The saving is a random percentage of client's starting wealth.

2.2.2 Go

This button runs di�erent instructions, see �g.2.4. Here we will show justthe code of the more complex commands, omiting the simpler.

• earn allows clients to have a salary, di�erentiated by social class ofmembership, every 30 ticks.

• open-business is more complicated (see �g. 2.5, where is reporteda part of the command): the �rst request is that a random numberbetween 0 and 1 is under the value of the slider openBarProbability,then, there are two possibilities to open a commercial activity, or payingcash the cost of the activity or asking for a loan.In this last case it must be satis�ed the conditions that a random

Page 15: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2.2. LOOKING AT THE CODE 15

Figure 2.4: go button commands

number is less than loanProbability and that the client has enough cash(how much depends on the activity) as guarantee for the bank. Theagent retire all his wealth from his bankaccount to pay some costs.Note that the bank, since the business doesn't fail, doesn't lose itsinvestiment.In both the cases the sold quantity of goods is setted on 0 at the openingof the business.

• spend contains �rst the instruction for the bank about when stopmaking loan. Then contains the instructions for the agents about howto spend their incomes. Here we just see two examples (see �g. 2.6 and2.7). The feature "stingy?" doesen't work for little expenses like in thebars, while it is important (as well as total wealth) for the program todecide how much a client spends in others shops, like in clothes shops.

• manageAccount (�g. 2.8 and 2.9) allows agents who has cash lessthan 100 to have cash again. There are two possibilities: the agent atissue can has or not has a bank account. In the �rst case, the agent canwithdraw part of their wealth stock: if he has a stock wealth includedbetween 500 and 1000 he withdraws with a probability of 30% 300 andwith a probability of 70% he retires 500. If his bank account containsmore than 1000, he withdraws the 50% of his wealth stock. Istead, ifhis bank account contains less than 100, he can ask a loan to the bank.With a probability equal to the loanProbability he will get a randomnumber between 1 and 1000 as cash.In the second case, when an agent has not a bank account, with a

Page 16: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

16 CHAPTER 2. THE MODEL

Figure 2.5: "open-business" command, instructions to open a bar

loanProbability he can create an account with the bank and he canreceive a loan.

• makePrices (�g.2.10): imagine to be in an old stock market: all thesellers declare the price with they want to sell a certein quantity oftheir goods (in the example of �g.2.10 this last is co�ee) and the sameis done by the buyers. That prices are put respectively in descendingorder in the list logS and in ascending order in the list logB. The priceof the goods became the �rst of the buyers prices list.

• payCosts (see �g. 2.11) contains the instructions for business to pay�xed and variable costs every month.

• closeActivity (�g. 2.12): when a business has a total income less acertein failureThreshold, this business fails and the owner becomes apoor stingy agent with no cash. The bank as well loses its investiment.

• failureBank: also the bank can fails, as we said before.

• Finally, we have crisisOn: this switch (�g. 2.13) asks to a randomnumber of agents, with a retireCashProbability to withdraw their wealthstock from their bank account.

Page 17: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2.2. LOOKING AT THE CODE 17

Figure 2.6: "spend" command, instructions to spend in a bar

Figure 2.7: "spend" command, instructions to spend in a clothes shop

Figure 2.8: "manageAccount" command, instructions to retire cash from bank

account or to ask a loan for the bank's clients

Page 18: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

18 CHAPTER 2. THE MODEL

Figure 2.9: "manageAccount" command, instructions to ask a loan for agents

that haven't a bank account

Page 19: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2.2. LOOKING AT THE CODE 19

Figure 2.10: "makePrices" command, instructions to set the co�ee price

Page 20: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

20 CHAPTER 2. THE MODEL

Figure 2.11: "paycosts" command

Figure 2.12: "closeActivity" command

Page 21: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

2.2. LOOKING AT THE CODE 21

Figure 2.13: "crisisOn" switch

Page 22: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

22 CHAPTER 2. THE MODEL

Page 23: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

Chapter 3

Results and Conclusions

As we said in the presentation of this work, the model analysis will focusin �nding the best values of parametres such that the bank fails in thelongest/shortest possible time, in the presence or absence of a crisis.All the simulations are runned with 300 agents. In presence of crisis everysimulation is runned for 100 model steps and the best simulation is runnedfor 10 times.To search these conditions we measure, with behaviorSearch, the �tness, thatis the global variable days of the bank, at the �nal step, that is the step inwhich the bank fails.Analysing the model in presence of crisis, we will search for results graduallyincreasing the probability that agents withdraw deposits.

3.1 CrisisOn:

increasing retireCashProbability results

Here we present the simulations results in which retireCashProbability hasrespectively the value of 0.2, 0.4, 0.6 and 0.8 in both the cases of maximizingand minimizing �tness (or rather the number of simulation days).Note that we leave out the maximum and minimum value (0 and 1) of re-tireCashProbability because the �rst is the same of turning o� the crisisOn

button (a case that we will see in the next section), and the second becauseit is trivial.

3.1.1 Maximizing Fitness

We can observe the results obtained maximizing �tness in �g. 3.1, 3.2, 3.3and 3.4.

23

Page 24: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

24 CHAPTER 3. RESULTS AND CONCLUSIONS

Figure 3.1: retireCashProbability = 0.2 Best Fitness = 92.2 loan-Probability = 0.99 bankAccountThreshold = 0.85 barPauseProbability =0.1 stingyClientsRate = 0.8 failureThreshold = 237 openBarProbability =0.86 openClothesShopProbability = 0.86 openExClshopProbability = 0.75openSupermarketProbability = 0.48 crisis = true

As we could expect, increasing the value of retireCashProbability we obtaina lower �tness. What is maybe not intuitive in a �rst thought is the highvalue in output, for every simulation, of loanProbability.Our �rst thought could be that in order to not fail the bank should denyloans. In reality, it is correct that loanProbability value is high, in fact thebank fails when the agents withdraw their deposits. So, if there are lessagents that can do this in the simulation it is better for the bank. Sinceshops hasn't deposits, because they earn in cash (as it was built this model),the simulation lasts longer (and �tness increases) when more agents becameowner of a shop.

3.1.2 Minimizing Fitness

Repeating the same simulations but �xing the bankAccountThreshold = 1 (toavoid the trivial result of �tness = 0 because bankAccountThreshold = 0, orrather because there aren't bank clients) and minimizing �tness, we obteinresults in �g. 3.5, 3.6, 3.7 and 3.8.As we could expect from the last simulations, here the loanThreshold is 0 in

Page 25: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

3.1. CRISISON:INCREASING RETIRECASHPROBABILITY RESULTS25

Figure 3.2: retireCashProbability = 0.4 Best Fitness = 88.5 loan-Probability = 0.97 bankAccountThreshold = 0.66 barPauseProbability =0.64 stingyClientsRate = 0.77 failureThreshold = 429 openBarProbability =0.94 openClothesShopProbability = 0.05 openExClshopProbability = 0.77openSupermarketProbability = 0.7 crisis = true

Page 26: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

26 CHAPTER 3. RESULTS AND CONCLUSIONS

Figure 3.3: retireCashProbability = 0.6 Best Fitness = 87.9 loan-Probability = 0.97 bankAccountThreshold = 0.66 barPauseProbability =0.64 stingyClientsRate = 0.77 failureThreshold = 429 openBarProbability =0.94 openClothesShopProbability = 0.05 openExClshopProbability = 0.77openSupermarketProbability = 0.70 crisis = true

Page 27: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

3.1. CRISISON:INCREASING RETIRECASHPROBABILITY RESULTS27

Figure 3.4: retireCashProbability = 0.8 Best Fitness = 87.1 loan-Probability = 0.97 bankAccountThreshold = 0.66 barPauseProbability =0.64 stingyClientsRate = 0.77 failureThreshold = 429 openBarProbability =0.94 openClothesShopProbability = 0.05 openExClshopProbability = 0.77openSupermarketProbability = 0.70 crisis = true

Page 28: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

28 CHAPTER 3. RESULTS AND CONCLUSIONS

Figure 3.5: retireCashProbability = 0.2 Best Fitness = 11.3 loan-Probability = 0.01 barPauseProbability = 0.43 stingyClientsRate = 0.35failureThreshold = 624 openBarProbability = 0.72 openClothesShopProba-bility = 0.30 openExClshopProbability = 0.17 openSupermarketProbability= 0.63 crisis = true

all the runs.Di�erently from the previus runs, also, the loanThreshold is very low in allthe simulations, for the motivation discussed in the last subsection. Anotherthing we can note is that the �tness decreases when the value of retireCash-Probability increases. This is intuitive because if the probability to withdrawdeposits increases the bank will fail in a shorter time.

3.2 CrisisO�: results

Turning o� the crisisOn button the value of retireCashProbability loses itssense. Furthermore we will simulate just the case of minimizing �tness,because in absence of a crisis, when the end of the bank is not certain,maximizing �tness the simulation would take too much time. Also in thiscase, we set bankAccountThreshold = 1 to avoid the trivial result of �tness0 just because bankAccountThreshold = 0.

Page 29: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

3.2. CRISISOFF: RESULTS 29

Figure 3.6: retireCashProbability = 0.4 Best Fitness = 5.80 loan-Probability = 0.05 barPauseProbability = 0.75 stingyClientsRate = 0.68failureThreshold = 790 openBarProbability = 0.63 openClothesShopProba-bility = 0.90 openExClshopProbability = 0.07 openSupermarketProbability= 0.64 crisis = true

Page 30: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

30 CHAPTER 3. RESULTS AND CONCLUSIONS

Figure 3.7: retireCashProbability = 0.6 Best Fitness = 3.40 loan-Probability = 0.01 barPauseProbability = 0.90 stingyClientsRate = 0.87failureThreshold = 541 openBarProbability = 0.14 openClothesShopProba-bility = 0.24 openExClshopProbability = 0.49 openSupermarketProbability= 0.00 crisis = true

Page 31: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

3.2. CRISISOFF: RESULTS 31

Figure 3.8: retireCashProbability = 0.8 Best Fitness = 1.90 loan-Probability = 0.05 barPauseProbability = 0.75 stingyClientsRate = 0.68failureThreshold = 790 openBarProbability = 0.63 openClothesShopProba-bility = 0.90 openExClshopProbability = 0.07 openSupermarketProbability= 0.64 crisis = true

Page 32: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

32 CHAPTER 3. RESULTS AND CONCLUSIONS

Figure 3.9: Best Fitness = 71.9 loanProbability = 0.96 barPauseProbabil-ity = 0.41 stingyClientsRate = 0.35 failureThreshold = 864 openBarProba-bility = 0.69 openClothesShopProbability = 0.99 openExClshopProbability= 0.00 openSupermarketProbability = 0.72 crisis = false

We obtain as best �tness 71,9.

Page 33: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

3.3. CONCLUSIONS 33

3.3 Conclusions

SIMULATIONS RESULTS SUMMARYFixed Values nClients = 300; crisis = trueNum.Simulation 1 2 3 4retireCashProb. 0.2 0.4 0.6 0.8Parameters Min Max Min Max Min Max Min MaxloanProb. 0.01 0.99 0.05 0.97 0.01 0.97 0.05 0.97bankAcc.Thres. / 0.85 / 0.66 / 0.66 / 0.66barPauseProb. 0.43 0.10 0.75 0.64 0.90 0.64 0.75 0.64stingyCl.Rate 0.35 0.80 0.68 0.77 0.66 0.77 0.66 0.77failureThr. 624 237 790 429 541 429 790 429openB.Prob. 0.72 0.86 0.63 0.94 0.14 0.94 0.63 0.94openCl.S.Prob. 0.30 0.86 0.90 0.05 0.24 0.05 0.90 0.05openEx.Cl.S.Prob. 0.17 0.75 0.07 0.77 0.49 0.77 0.07 0.77openS.m.Prob. 0.73 0.48 0.64 0.70 0 0.70 0.64 0.70Best Fitness 11.3 92.2 5.8 88.5 3.40 87.9 1.90 87.1

In conclusion, we can confront all our runs results.Regarding the simulations with crisis, looking at the summary in the previustable, we can note that some of the best parameters values are the samefor di�erent simulations (or rather simulations with a di�erent setting of re-tireCashProbability). For example, look at the simulation number 2,3 and4: the columns of Max (Maximize Fitness) are the same except to the BestFitness values, that however are very similar. The �rst simulation, instead,has di�erent best parameters values and also the best �tness deviates morethan others.As for minimizing �tness, all the columns of Min are di�erent, and in partic-ular the best �tness values are separed more than one unit. We can concludethat in case of maximizing �tness, the �xed value of retireCashProbabilityis less in�uent than in the case of minimizing �tness. We can explain thisresult in this way: since in the �rst case the bank has less liquid deposits,the percentage of agents who withdraw their cash is less in�uent, while it ismore important for the bank do not lose investiments. For this reason thebest failureThreshold value is lower than in case of minimizing �tness.Futhermore, the percentage of stingy people, in all the simulations, is higherwhen we maximize �tness. An explanation of that could be this one: if peo-ple spend too much it is probable they ask for a loan to the bank. SinceloanProbability is very high, it is likely for them to get the loan. But, since

Page 34: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

34 CHAPTER 3. RESULTS AND CONCLUSIONS

this people give few guarantees to return the loan to the bank, it is betterthat they are in a low percentage.Another curious thing regards opening shops di�erent probabilities. Whenwe minimize �tness, in all the cases we note that this probabilities are gener-ally higher than in case of minimizing �tness. In particular, this di�erence isvery strong in openExpensiveClShopsProbability, while it is slight in openSu-

permarketProbability. This indicates that, according to what was said before,when we want maximize �tness, the bank prefers to invest its deposits to notfail in a short time: as a consequence it gives loan with an high probabilityand also the probability of opening shops must be high. But how can weexplain why there are so much di�erence among opening expensive clothesshops probability (maximizing and minimizing �tness) and not so much inopening supermarkets probability? Evidently it must be a more safe investi-ment for the bank an expensive clothes shop than a supermarket.

In the case in which there isn't a crisis, we obtained these results:

SIMULATION RESULTS SUMMARYFixed Values nClients = 300; crisis = false

loanProbability 0.96barPauseProb. 0.41

stingyClientsRate 0.35failureThreshold 864openBarProb. 0.69

openClShopProb. 0.99openExClShopProb. 0.00

openSupermarketProb. 0.72Best Fitness 71.90

As we can see, the �tness is much higher than in presence of a crisis. Sincethere isn't the retireCashProbability, to fail the bank has to lose much possibleof its investiments, so the loan probability is high, the failure threshold is thehighest of all our runs results and the percentage of stingy clients is low.Finally, we note that the probability to open an expensive clothes shop iszero, maybe because it is di�cult that it fails, as there are few agents thatcan open one of this shops, so that clients has no many choice and theyare obliged to buy in the same few shops. This type of business is a goodinvestiment for the bank both in absence and in presence of crisis, as we haveseen before.

Page 35: UNIVERSITY OF TURIN...1.1 ABMs and NetLogo This idea was built using NetLogo (since 1999), a multi-agent programmable modeling environment authored by Uri Wilensky and developed at

Bibliography

[1] NetLogo Home Page, https://ccl.northwestern.edu/netlogo/.

[2] BehaviorSearch Home Page, http://www.behaviorsearch.org.

[3] Eiben, A. E. et al (1994). "Genetic algorithms with multi-parent recom-bination".

35


Recommended