modelo con redes
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain) El modelo intenta explicar la manera en la cual los agentes interactúan, bajo ciertos supuestos de comportamiento y de información
HOW IT WORKS
La utilidad de los agentes tiene dos componentes: un componente individual (t-type), que está definido exógenamente; un componente social (c-type), que depende de cuántas personas eligen un determinado producto en el período anterior, en el entorno. En este modelo, en el período 0 se define aleatoriamente a qué t-type y c-type pertenece cada agente. Esta manera de modelizar la utilidad nos permite estudiar distintas tipologías de agentes: Pavlovianos, conformistas y aversos a la pérdida. También podemos estudiar este modelo para distintas cantidades de tipos de aglomeración y de preferencias individuales (está más explicado en la sección "Modelo" del proyecto de tesis). La persona también puede elegir de manera aleatoria su decisión de consumo; estudiamos si este modelo es estable frente a mutaciones.
HOW TO USE IT
- Para cambiar la cantidad de crowding types, mover la barra "ct_opciones" al número deseado (del 1 al 4, en principio)
- Podemos elegir el tipo de comportamiento de los individuos con el chooser "comport".
- Si queremos que un cierto porcentaje de los individuos elijan de forma aleatoria, l damos un valor positivo a la barra "prob_mut".
- Si queremos tener una cantidad aleatoria de cada tipo, seleccionamos "Setup". En cambio, si queremos comenzar con una cantidad determinada del crowding type 1, movemos la barra al porcentaje deseado y seleccionamos "setup c_type". El resto de los crowding types se dividen el resto de manera aleatoria.
- Para que el modelo avance un período, presionar el botón "go once". Para que avance continuamente, presionar "go".
THINGS TO NOTICE
El cuadro "c-type = t-type" muestra el porcentaje de agentes cuyas preferencias individuales (t-type) coinciden con la elección realizada (c-type). Se puede ver que la información que obtienen los agentes en el proceso de interacciones, permite aumentar la cantidad de agentes que consumen su bien preferido; las presiones sociales hacen que ese valor se estabilice e incluso baje con el correr del tiempo. Por la manera en que se define el modelo, es razonable suponer que se va a llegar a consensos de forma más rápida en el tipo de comportamiento "conformista", mientras que el tipo de comportamiento Pavloviano, se forman grupos de un radio menor. En este último caso, las preferencias individuales tienen un mayor paso. EL gráfico que figura abajo y a la izquierda de la pantalla, muestra el porcentaje de individuos que consumen cada bien. En color negro, se grafica el porcentaje de agentes para los cuales t-type = c_type. (suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
- Se puede extender agregando porcentajes de cada uno de los tipos de comportamiento.
- Se puede pensar en cambiar de ubicación a los agentes luego de cada paso y ahí sí calcular su utilidad con los nuevos vecinos (más parecido al ejemplo de los resorts, que puede hacerse con "turtles" y links".
- Se pueden pensar otro tipo de comportamientos para el modelo
- El entorno de los individuos puede tener un radio mayor (ver modelo en ejemplos de NetLogo)
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
El modelo "VOTING" es una primera aproximación a las preferencias sociales. En el modelo "SEGREGATION" los agentes cambian a otra ubicación (no cambian el bien a consumir o sus preferencias).
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
_ citar (a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
extensions [ ] globals [ a ; parámetro del t-type b ; parámetro de la cantidad de neighbors con el mismo c-type c ; parámetro de la cantidad de neighbors con distinto c-type t1-patches t2-patches c1-patches c2-patches max-align-turn ] turtles-own [ vote c-type ;; crowding type t-type ;; taste type tt-type ;; taste type a medida que avanza el juego tt-type_old ; tt-type en el período anterior neighbors_b neighbors_c total_1 total_2 total_3 total_4 total_5 u u_old u_1 u_2 u_3 u_4 u_5 xcor_old ycor_old my-neighbors my-c-neighbors no-my-c-neighbors num-neighbors num-c-neighbors ;; para cuando hay dos ct_opciones, definimos la cantidad inicial de cada uno (con la barra) ] to setup_3 clear-all set max-align-turn 180 crt 400 [ move-to one-of patches with [ not any? turtles-here ] ] ask turtles [ ifelse ( random-float 1.000 <= c-type_1 ) [ set c-type 1 ] [ set c-type ( 2 + random ((ct_opciones - 1)))] ifelse ( random-float 1.000 <= t-type_1 ) [ set t-type 1 ] [ set t-type ( 2 + random ((tt_opciones - 1)))] recolor-agent ] ask turtles [ ifelse ( ycor < 0 ) [ set tt-type 1 ] [ set tt-type 2 ] set tt-type_old tt-type set my-neighbors (other turtles) in-radius radio set num-neighbors count my-neighbors if ( num-neighbors = 0 ) [ set my-neighbors turtles ] ; set shape "default" ; set color white ] set t1-patches patches with [pycor < 0] ask t1-patches [ set pcolor white ] set t2-patches patches with [pycor > 0] ask t2-patches [ set pcolor white ] set c1-patches patches with [pxcor < 0] set c2-patches patches with [pxcor > 0] ; set t1c2-patches patches with [pxcor < 0 and pycor > 0] ; ask t1c2-patches [ set pcolor green ] ; set t2c2-patches patches with [pxcor 0 and pycor > 0] ; ask t2c2-patches [ set pcolor green + 1] ;ask turtles ; [ set c-type 1 + random ( ct_opciones ) ; set t-type 1 + random ( tt_opciones ) recolor-agent] ask turtles [ if ( c-type = 1 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 1 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 1 ] ) ] if ( c-type = 2 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 2 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 2 ] ) ] if ( c-type = 3 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 3 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 3 ] ) ] if ( c-type = 4 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 4 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 4 ] ) ] if ( c-type = 5 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 5 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 5 ] ) ] set num-c-neighbors count my-c-neighbors if ( num-c-neighbors = 0 ) [ set my-c-neighbors turtles ] ] if ( comport = "Pavloviano" ) [ set a 1 set b 1 set c 1 ] if ( comport = "conformista" ) [ set a 0 set b 0 set c 1 ] if ( comport = "averso_perdida" ) [ set a 1 set b 1 set c 2 ] if ( comport = "exclusivo" ) [ set a 1 set b -1 set c -1 ] ask turtles [ set total_1 count my-neighbors with [ c-type = 1 ] set total_2 count my-neighbors with [ c-type = 2 ] set total_3 count my-neighbors with [ c-type = 3 ] ;; use two ask patches blocks so all patches compute "total" set total_4 count my-neighbors with [ c-type = 4 ] ;; before any patches change their c-types set total_5 count my-neighbors with [ c-type = 5 ] if ( c-type = 1 ) [ set neighbors_b total_1 set neighbors_c total_2] if ( c-type = 2 ) [ set neighbors_b total_2 set neighbors_c total_1] ; set neighbors_b count my-neighbors with [ c-type = ] ; set neighbors_c count my-neighbors with [ c-type != c-type of myself ] set u_1 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 1 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_2 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 2 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_3 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 3 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_4 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 4 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_5 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 5 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u max (list u_1 u_2 u_3 u_4 u_5) ] reset-ticks end to go ask turtles [ set tt-type_old tt-type set u_old u set xcor_old xcor set ycor_old ycor set u max (list u_1 u_2 u_3 u_4 u_5) ] ask turtles [ set my-neighbors (other turtles) in-radius radio if ( my-neighbors = 0 ) [ set my-neighbors turtles ] set num-neighbors count turtles ] ask turtles [ set tt-type ifelse-value (( u_1 > u_2 ) and (u_1 > u_3) and (u_1 > u_4)) [ 1 ][ ifelse-value ((u_2 > u_1) and (u_2 > u_3) and (u_2 > u_4)) [ 2 ] [ ifelse-value ((u_3 > u_1) and (u_3 > u_2) and (u_3 > u_4))[ 3 ] [ ifelse-value ((u_4 > u_1) and (u_4 > u_2) and (u_4 > u_3)) [ 4 ][ 1 + random ct_opciones ] ] ] ] recolor-agent ] ; mutaciones ask turtles [ if ( random-float 1.000 <= prob_mut ) [ set tt-type 1 + random ct_opciones ] recolor-agent ] ask turtles [ if ( tt-type = 1 and ycor > 0 ) [ set ycor ( - ycor )] if ( tt-type = 2 and ycor < 0 ) [ set ycor ( - ycor ) ] ] ; ahora se mueve ask turtles [ if ( tt-type = 1 and tt-type_old != 1) [ move-to one-of t1-patches ] if ( tt-type = 1 and tt-type_old = 1 and u >= u_old and ycor <= -1 ) [ align fd 1 right 2] ;[ move-to one-of t1-patches ] if ( tt-type = 1 and tt-type_old = 1 and u < u_old and ycor <= -1 ) [ align fd 0 left 2] ;[ move-to one-of t1-patches ] ; if ( tt-type = 1 and ycor >= - 1 ) [ move-to one-of t1-patches ] if ( tt-type = 2 and tt-type_old != 2) [ move-to one-of t2-patches ] if ( tt-type = 2 and tt-type_old = 2 and u >= u_old and ycor >= 1 ) [ align fd 1 right 2 ] if ( tt-type = 2 and tt-type_old = 2 and u < u_old and ycor >= 1 ) [ align fd 0 left 2 ] ;[ move-to one-of t2-patches ] ; if ( tt-type = 2 and ycor <= 0 ) [ move-to one-of t2-patches ] ifelse (tt-type != t-type) [ set shape "square" ] [ set shape "default"] ;ifelse ( c-type = 1) [move-to one-of c1-patches ] [move-to one-of c2-patches ] ] ;export-interface (word "frame_25" but-first (word (100 + ticks)) ".png") tick ; cuenta nuevamente ask turtles [ set total_1 count my-neighbors with [ c-type = 1 ] set total_2 count my-neighbors with [ c-type = 2 ] set total_3 count my-neighbors with [ c-type = 3 ] ;; use two ask patches blocks so all patches compute "total" set total_4 count my-neighbors with [ c-type = 4 ] ;; before any patches change their c-types set total_5 count my-neighbors with [ c-type = 5 ] ] ask turtles [ if ( c-type = 1 ) [ set neighbors_b total_1 set neighbors_c total_2 + total_3 + total_4 + total_5 ] if ( c-type = 2 ) [ set neighbors_b total_2 set neighbors_c total_1 + total_3 + total_4 + total_5 ] if ( c-type = 3 ) [ set neighbors_b total_3 set neighbors_c total_1 + total_2 + total_4 + total_5 ] if ( c-type = 4 ) [ set neighbors_b total_4 set neighbors_c total_1 + total_2 + total_3 + total_5 ] if ( c-type = 5 ) [ set neighbors_b total_5 set neighbors_c total_1 + total_2 + total_3 + total_4 ] set u_1 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 1 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_2 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 2 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_3 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 3 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_4 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 4 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) set u_5 a * ( 1 / ct_opciones ) * ( ifelse-value (t-type = 5 ) [ 1 ] [ 0 ] ) + b * ( neighbors_b / num-neighbors ) - c * ( neighbors_c / num-neighbors ) ] ; set u_1 a * ( 1 / ct_opciones ) * ( ifelse-value (tt-type = 1 ) [ 1 ] [ 0 ] ) + b * ( total_1 / num-neighbors ) - c * ( count my-neighbors with [ c-type != 1 ] / num-neighbors ) ; set u_2 a * ( 1 / ct_opciones ) * ( ifelse-value (tt-type = 2 ) [ 1 ] [ 0 ] ) + b * ( total_2 / num-neighbors ) - c * ( count my-neighbors with [ c-type != 2 ] / num-neighbors ) ; set u_3 a * ( 1 / ct_opciones ) * ( ifelse-value (tt-type = 3 ) [ 1 ] [ 0 ] ) + b * ( total_3 / num-neighbors ) - c * ( count my-neighbors with [ c-type != 3 ] / num-neighbors ) ; set u_4 a * ( 1 / ct_opciones ) * ( ifelse-value (tt-type = 4 ) [ 1 ] [ 0 ] ) + b * ( total_4 / num-neighbors ) - c * ( count my-neighbors with [ c-type != 4 ] / num-neighbors ) ; set u_5 a * ( 1 / ct_opciones ) * ( ifelse-value (tt-type = 5 ) [ 1 ] [ 0 ] ) + b * ( total_5 / num-neighbors ) - c * ( count my-neighbors with [ c-type != 5 ] / num-neighbors ) ; ] ask turtles [ if ( c-type = 1 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 1 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 1 ] ) ] if ( c-type = 2 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 2 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 2 ] ) ] if ( c-type = 3 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 3 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 3 ] ) ] if ( c-type = 4 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 4 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 4 ] ) ] if ( c-type = 5 ) [ set my-c-neighbors ( my-neighbors with [ c-type = 5 ] ) set no-my-c-neighbors ( my-neighbors with [ c-type != 5 ] ) ] set num-c-neighbors count my-c-neighbors if ( num-c-neighbors = 0 ) [ set my-c-neighbors turtles ] ] end to align ;; turtle procedure turn-towards average-flockmate-heading max-align-turn end to-report average-flockmate-heading ;; turtle procedure ;; We can't just average the heading variables here. ;; For example, the average of 1 and 359 should be 0, ;; not 180. So we have to use trigonometry. let x-component ( mean [dx] of my-c-neighbors ) ; ver con la suma, la media o la mediana let y-component ( mean [dy] of my-c-neighbors ) ifelse x-component = 0 and y-component = 0 [ report heading ] [ report atan x-component y-component ] end to turn-towards [new-heading max-turn] ;; turtle procedure turn-at-most (subtract-headings new-heading heading) max-turn end to turn-away [new-heading max-turn] ;; turtle procedure turn-at-most (subtract-headings heading new-heading) max-turn end to turn-at-most [turn max-turn] ;; turtle procedure ifelse abs turn > max-turn [ ifelse turn > 0 [ rt max-turn ] [ lt max-turn ] ] [ rt turn ] end to recolor-agent ;; colorear ifelse c-type = 1 [ set color red] [ ifelse c-type = 2 [ set color green ] [ ifelse c-type = 3 [ set color blue ] [ ifelse c-type = 4 [ set color yellow ] [ set color white ] ] ] ] end
There are 3 versions of this model.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.