hyperlink - How to create dynamic links in Netlogo? - Global variables change values for agents, agents interact and then change their type accordingly -


i have system 2 global/systemic variables economic-output-x , environmental-damage-y depend on distribution of 4 types of worldviews (utility-assumptions) of agents in model. these 2 state variables distributed internal values among agents income , exposure. these 2 marginal or individual distributed valus determine power persuade (p2p) , susceptibility persuasion (s4p). each agent therefore has p2p-x , p2p-y s4p-x , s4p-y.

when 2 agents meet (compare former related question) exchange internal values of p2p , s4p, conceptualised debate, discussion or clash of opinions. if substraction of these values results in number above particular threshold, i.e. range between 2 values high, 'losing' agent changes worldview other one's worldview (transition), in turn has impact on global variables.

therefore have quite nested network of interrelationships , feedback loops. having problems putting practice. have looked @ quite opinion-influence-models none quite grasps way approaching it.

my first attempt looked this:

     ask turtles [        ; agents doing thing   [if occupied = "yes" [     ifelse count-down > 0        [set count-down (count-down - 1)]      [; hell out of here        rt 180        fd 2        set occupied "no"        set count-down 3]         ]        if occupied = "no" [       ; wandering around, ignoring occupied agents      set neighbourhood other turtles in-radius 2]       ; if interesting , unoccupied near, communicate!      set nearest-neighbour one-of neighbourhood with-min [distance myself]      ifelse nearest-neighbour != nobody [    ; in case has been set nearest-neighbour, encounter set in motion          if ([ occupied ] of nearest-neighbour = "no") [             face nearest-neighbour                         set occupied "yes"  
 [if ([ s4p-x ]  of self < [ p2p-x ] of nearest-neighbour) [ 

set worldview [ worldview ] of nearest-neighbour ]

            ask nearest-neighbour [                face myself                             set occupied "yes" 

if ([ s4p-x ] of self < [ p2p-x ] of myself) [set worldview [ worldview ] of myself ]

           ] 

but did not work out. plus, not quite sure whether elegant way. doubt it. there maybe entry on topic on stackoverflow overlooked, little easier grasp? or functionality in netlogo, might fit needs more appropriately?

thanks in advance.

i think mean p2p-x instead of [p2p-x] of myself, , think mean set worldview [worldview] of myself instead of set worldview [worldview of myself]. fix it?

you don't need use links unless want represent relationship between turtles persists on time. if encounters between turtles fleeting, involving links doesn't buy anything.

i'd suggest @ communication t-t example in code examples section of models library, , @ other models pairs of turtles meet , interact, such pd n-person iterated.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -