Diminished F’NF
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Diminished F'NF
Darwin goes to El Farol Bar: Self-Organized Efficiency in an Extremely Simplified Evolutive Game
WHAT IS IT?
This model serves as a simplified version of the Flibs'NFarol model [1], aiming to illustrate that bar attendance can exhibit fluctuations and eventually asymptotically converge around the bar's capacity threshold even when the population of agents employs a very limited set of strategies.
HOW IT WORKS
The genetic algorithm framework of the Flibs'NFarol model is retained in this implementation, but with a key reduction: flibs, the agents within the simulation, have only one state. This single state allows for the existence of four different chromosomes alleles, each encoding distinct strategies. The Diminished F'NF population can accommodate two of the four possible chromosomes. The processes of recombination and mutation are amalgamated into a unified procedure, responsible for replacing one less-performing flib with either the second allele or a clone of itself.
HOW TO USE IT
The user interface provides tools to execute experiments and comprises input controls (sliders, choosers, and buttons) and output devices (monitors, plots, and the world window).
Input controls
SLIDERS
- NUM-FLIBS determines the number of flibs in the simulation, set at 100 by default, following the standard Arthur's model. -THRESHOLD sets the fraction of the flibs' population that can comfortably attend the EFB, with a default value of 0.6, consistent with the standard Arthur's model.
CHOOSERS
- CHROM-COUPLE allows you to select one pair of alleles that will participate in the simulation.
- EW-REWARD enables the selection of the reward for flibs that choose not to attend the bar when it is overcrowded.
BUTTONS
- SETUP resets the system and prepares the model for execution.
- TO GO ... executes only one season at EFB
- OR NOT TO GO? continuously runs the model until it is turned off.
Output devices
MONITORS
- RUN. AVG. ATTENDANCE shows the updated running average of attendance.
- RUN. AVG. GINI INDEX shows the updated running average of the Gini index.
- WORST FT. shows the current worst fitness.
- AVERAGE FT shows the current average fitness.
- BEST FT. shows the current best fitness.
PLOTS
- ATTENDANCE HISTORY displays the value of the threshold (brown line), the mean fraction of flibs attending the bar (orange line) and its running average (green line) over time (ticks).
- FITNESS DISTRIBUTION displays the current distribution of fitness values in the flibs population.
- LORENZ CURVE: displays the current fairness distribution in the access to EFB.
- GINI INDEX displays the flibs' Gini index (yellow line) and the running average of the Gini index (green line) over time (ticks). The Gini index is a measure of the inequality degree within the flibs' population. A Gini index of 0 is related to perfect equality, while a Gini coefficient of 1 is related to maximal inequality among fitness values.
THE WORLD
- The World is a dynamic pictogram where a number of flibs move between two distinct areas: 'El Farol' Bar (yellow) and 'Elsewhere' (blue). The coordinates of a flib are not relevant; the only important thing is whether it is in the area of the bar or not. The colour of the flibs reflects their fitness level: white stands for 0%, black for 100% and red shades stand for intermediate fitness values.
THINGS TO TRY
- Experiment with different chromosome/strategy pairs to observe their impact on achieving a balanced ecosystem.
- Investigate whether asymmetric reward systems can influence the effectiveness of resource exploitation within the population.
- Compare the Gini index values obtained in balanced ecosystems with those presented in the ODD-protocol appendix attached to the Flibs'NFarol executable file [1].
CREDITS AND REFERENCES
- Cosimo Leuci (2023, October 12). “Flibs’NFarol: Self-Organized Efficiency and Fairness Emergence in an Evolutive Game” (Version 1.0.0). CoMSES Computational Model Library. Retrieved from: https://doi.org/10.25937/fdxs-2479
COPYRIGHT AND LICENSE
Copyright 2023 Cosimo Leuci.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Comments and Questions
;; _________________________________________________________________________________________________________________ ;; ;; ---------------------- Diminished-F'NF ---------------------------------------------------- Diminished-F'NF ;; Diminished-F'NF ------------------------------------------------ Diminished-F'NF -------------------------- ;; _________________________________________________________________________________________________________________ breed [flibs flib] ;; FLiBs (finite living blobs) are the agents of the model: they are structured as ;; one state finite automata. A binary input signal coming from the previous state of ;; the environment (1 if the bar was crowded, 0 if not) causes it to generates binary ;; signals as a decision to go or not to go. Four strategies are possible. flibs-own [chromosome ;; every flib owns a chromosome, that is a string codifying one of the four schema state ;; the current inner state of the flib: it is always 0 choice ;; choice/prevision expressed by the flib regarding to go or not to go to the bar fitness ;; a measure of flibs' prevision ability to forestall if the bar will be crowded or not ] globals [tot_attend ;; total of attendances during one season to "El Farol" bar (i.e. 100 cycles tournement) sigma_attend ;; an accumulator for the previous variable crowded ;; a switch recording the state of the bar: 1 if crowded, 0 if not lorenz-points ;; list of the Lorenz curve ordinates gini-index-reserve;; counter functional to the calculation of the Gini index sigma-gini ;; an accumulator for the previous variable best ;; the best flibs fitness value worst ;; the worst flibs fitness value ] ;; ---------- SETUP PROCEDURES ---------------------------------------------------------------------------------- ;; ------------------------------------------------------------------------------------------------------------------ to setup ;; initializing the model clear-all ;; create the bar area (yellow) and an elsewhere (blue) ask patches [set pcolor blue - 3] ask patches with [abs pxcor < 10 and abs pycor < 7] [set pcolor yellow] ask patches with [pxcor = 9 and pycor = 7] [set plabel ["El Farol Bar"]] ask patches with [pxcor = 21 and pycor = -21] [set plabel ["Elsewhere"]] ;; create the flibs and give them a random chromosome ask n-of num-flibs patches [sprout-flibs 1 [ set shape "flib" set color white set size 2 set chromosome one-of chrom-couple ] ] reset-ticks end ;; ---------- RUNTIME PROCEDURES -------------------------------------------------------------------------------- ;; ------------------------------------------------------------------------------------------------------------------ to go set tot_attend 0 ask flibs [set fitness 0 set state 0] repeat 100 [el-farol] ;; a 100 cycles tournament could be seen as a season to "El Farol" bar (i.e. 100 evenings) if sum [fitness] of flibs = 0 [ ;; no fitness no progress show "fitness null for every flibs" stop ] analyse ;; some relevant "El Farol" seasonal results are picked and processed ask flibs [move] ;; the world displays a snapshot of the bar after the last evening of the season if best != worst[ ;; after every season, one cloning event can occur: the process is partly selective ask one-of flibs with [fitness = worst] [set chromosome one-of chrom-couple ] ] tick end ;; ONE SEASON TO EL FAROL BAR ;; ------------------------------------------------------------------------------------------------------------------- to el-farol let attendance 0 ;; the variable records the fraction of agents attending the bar during one evening flibs-behaviour ;; bar attendance is the sum of every flibs' choices set attendance sum [choice] of flibs / num-flibs ;; comparing the attendance and the threshold value, the (over)crowded state of the bar is determined if attendance >= threshold [set crowded 1 ;; if the bar is crowded, reward the flibs that are elsewhere ask flibs with [choice = 0] [set fitness fitness + EW_reward] ] if attendance < threshold [set crowded 0 ;; if the bar is not crowded, reward the flibs that are attending ask flibs with [choice = 1] [set fitness fitness + 1] ] set tot_attend tot_attend + attendance ;; the results of every evening of a season is added up end to flibs-behaviour ask flibs [ ;; each flib processes its choice (to go or not to go) set choice read-from-string item (2 * crowded) chromosome ] end to analyse set best max [fitness] of flibs set worst min [fitness] of flibs ask flibs [set color scale-color red fitness 100 0] set sigma_attend sigma_attend + tot_attend / 100 update-lorenz-and-gini end to update-lorenz-and-gini ;; borrowed from Wilensky's model "Wealth Distribution" let sorted-comfort sort [fitness] of flibs let total-comfort sum sorted-comfort let comfort-sum-so-far 0 let index 0 set gini-index-reserve 0 set lorenz-points [] repeat num-flibs [ set comfort-sum-so-far (comfort-sum-so-far + item index sorted-comfort) set lorenz-points lput ((comfort-sum-so-far / total-comfort) * 100) lorenz-points set index (index + 1) set gini-index-reserve gini-index-reserve + (index / num-flibs) - (comfort-sum-so-far / total-comfort) ] set sigma-gini sigma-gini + ((gini-index-reserve / num-flibs) * 2) end to move ifelse choice = 0 [move-to one-of patches with [pcolor = blue - 3]] [move-to one-of patches with [pcolor = yellow]] end ; Copyright 2023 Cosimo Leuci. ; See Info tab for full copyright and license.
There is only one version of this model, created almost 2 years ago by Cosimo Leuci.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Diminished F’NF.png | preview | preview_image | almost 2 years ago, by Cosimo Leuci | Download |