1

I have a system where the two global/systemic variables economic-output-x and environmental-damage-y depend on the distribution of four types of worldviews (utility-assumptions) of the agents in the model. These two state variables get distributed as internal values among all agents as income and exposure. These two marginal or individual distributed valus determine power to persuade (P2P) and susceptibility for persuasion (S4P). Each agent therefore has P2P-x and P2P-y as well as S4P-x and S4P-y.

When two agents meet (Compare former related question) they exchange their internal values of P2P and S4P, which could be conceptualised as a debate, a discussion or a clash of opinions. If the substraction of these values results in a number above a particular threshold, i.e. the range between the two values is high, the 'losing' agent changes his worldview to the other one's worldview (transition), which in turn has an impact on the global variables.

Therefore we have quite a nested network of interrelationships and feedback loops. I am having problems putting this into practice. I have also looked at quite some opinion-influence-models but none quite grasps it the way I am approaching it.

My first attempt looked like this:

     ask turtles [        ; Agents are doing their thing
  [if occupied = "yes" [
    ifelse count-down > 0 
      [set count-down (count-down - 1)]
     [; get the 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 someone interesting and unoccupied is near, communicate!
     set nearest-neighbour one-of neighbourhood with-min [distance myself]
     ifelse nearest-neighbour != nobody [    ; In case someone has been set as nearest-neighbour, encounter is 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 that did not really work out. Plus, I am not quite sure whether this is the most elegant way. I doubt it. Is there maybe an entry on this topic on Stackoverflow which I overlooked, which is a little easier to grasp? Or another functionality in NETLOGO, which might fit my needs more appropriately?

Thanks in advance.

Community
  • 1
  • 1
T-Saurus
  • 29
  • 4

1 Answers1

1

I think you probably mean just P2P-x instead of [P2P-x] of myself, and I think you mean set worldview [worldview] of myself instead of set worldview [worldview of myself]. Does that fix it?

You probably don't need to use links unless you want to represent a relationship between turtles that persists over time. If the encounters between turtles are fleeting, involving links doesn't buy you anything.

I'd suggest you look at Communication T-T Example in the Code Examples section of the Models Library, and at other models where pairs of turtles meet and interact, such as PD N-Person Iterated.

Seth Tisue
  • 29,985
  • 11
  • 82
  • 149
  • If I leave the brackets for the first case, so `P2P-x` I get the error that a reporter is needed. For the second case, he is not aware who `myself` is supposed to be, because the `face`-command comes later in the code... – T-Saurus Mar 11 '14 at 08:29
  • Re: the error, exactly what does the code look like that is giving you that error, and what is `P2P-x` anyway, a turtle variable, or what? As for `face`, I don't really know what you mean. You're using the wrong syntax for `of`, and my suggestion uses the right syntax; so you need to take that much of my advice, at least. I'm at a loss at what further advice to give you because I don't even understand the exact intent behind the code you've provided. I don't know what agent you _want_ `myself` to refer to in the two places you've used it. What precisely are you trying to do? – Seth Tisue Mar 11 '14 at 13:39
  • It seems like you're flailing a bit which probably means you need to slow down and take smaller steps. – Seth Tisue Mar 11 '14 at 13:41
  • I tried to clean it up again. Plese let me know if that helped. – T-Saurus Mar 12 '14 at 10:16
  • So the current code is practically impossible to read, because the indentation is so wildly inconsistent. Still, I can see that you made some fixes. Note that you can can replace `[S4P-x] of self` with just `S4P-x`; adding `[] of self` is always redundant. What question do you still have about the latest code? – Seth Tisue Mar 12 '14 at 12:45