**Appendix A. The NetLogo Code**

```
breed [ groupAmembers groupAmember ]
breed [ groupBmembers groupBmember ]
breed [ groupCmembers groupCmember ]
breed [ groupDmembers groupDmember ]
globals [
  Previous-DIV
  Previous-TA
  Previous-NE
  Previous-eIRR
  All-Previous-ROE
]
to setup
  clear-all
  reset-ticks
  set-default-shape turtles "person"
  setup-people
end
to setup-people
    create-groupAmembers Percent-of-Group-A-Members * Members/100 [
    setxy random-xcor random-ycor
    set color red
  ]
```

```
create-groupBmembers Percent-of-Group-B-Members * Members/100 [
          setxy random-xcor random-ycor
          set color green
       ]
       create-groupCmembers 0 [
          setxy random-xcor random-ycor
          set color cyan
       ]
       create-groupDmembers Members - count groupAmembers - count groupBmembers - count
groupCmembers [
          setxy random-xcor random-ycor
          set color orange
    end
    to go
       if count groupAmembers + count groupDmembers <= 0.5 * Members [
          stop
       ]
       if ticks = 0 [
         go-0
       ]
       if ticks = 1 or ticks = 2 [
         go-12
       ]
       if ticks > 2 [
          go-3n
       ]
       tick
    end
    to go-0
       let TA Initial-Total-Assets
       let ROE 0.025
       let NE TA * ROE
       let DIV 0
       ifelse NE <= 0
       [
          set DIV 0
       ]
       [
          let eIRR (random-normal 2.5 0.8)/100
          let eKm (random-normal 2.5 2.5)/100
          ifelse eIRR >= eKm
          [
            set DIV 0
          ]
          [
          set DIV NE
          ]
       ]
       set Previous-DIV DIV
```

```
set Previous-TA TA
```

```
set Previous-NE NE
  set All-Previous-ROE (list ROE)
end
to go-12
  let TA Previous-TA + Previous-NE - Previous-DIV
  let ROE (random-normal 2.5 2.5)/100
  let NE TA * ROE
  let DIV 0
  let eIRR 0
  ifelse NE <= 0
  [
     set DIV 0
  ]
  [
     set eIRR (random-normal 2.5 0.8)/100
     let eKm (random-normal 2.5 2.5)/100
     ifelse eIRR >= eKm
     [
       set DIV 0
     ]
     [
     set DIV NE
     ]
  ]
  set Previous-DIV DIV
  set Previous-TA TA
  set Previous-NE NE
  set Previous-eIRR eIRR
  set All-Previous-ROE fput ROE All-Previous-ROE
end
to go-3n
  print word "#" ticks
  let TA Previous-TA + Previous-NE - Previous-DIV
  let ROE (random-normal 2.5 2.5)/100
  let IRR (1.1 - random-float 0.2) * Previous-eIRR * (1 - bd/100)
  let NE Previous-TA * ROE + Previous-NE * IRR;
  print word "NE:" NE
  let DIV 0
  let eIRR 0
  let eKm 0
  ifelse NE <= 0
  [
     set DIV 0
  ]
  [
     set eIRR (random-normal 2.5 0.8)/100
     set eKm (random-normal 2.5 2.5)/100
     print word "eIRR:" eIRR
     print word "eKm:" eKm
     ifelse eIRR >= eKm
```

```
[
       set DIV 0
     ]
     [
     set DIV NE
     ]
  ]
  let CompanyROE NE/TA
  print word "CompanyROE:" precision CompanyROE 3
  let kM (1.1 - random-float 0.2) * eKm
  let aproe compute-aproe
  print word "aproe:" aproe
  let ROE* bad-decisions-intolerance/100 * max (list kM IRR aproe)
  print word "ROE*:" precision ROE* 3
  ifelse CompanyROE < ROE*
  [
     ask n-of (0.2 * count groupDmembers) groupDmembers
     [
       set breed groupCmembers
       set color cyan
     ]
  ]
  [
     print word "Scade C cu " (0.2 * count groupCmembers)
     ; scade numarul de agenti din grupul C
    if Group-C-Can-Return-To-Group-D
     [
       ask n-of (0.2 * count groupCmembers) groupCmembers
       [
        set breed groupDmembers
        set color yellow
       ]
     ]
  ]
  set Previous-DIV DIV
  set Previous-TA TA
  set Previous-NE NE
  set Previous-eIRR eIRR
  set All-Previous-ROE fput ROE All-Previous-ROE
end
to-report compute-aproe
  let i 0;
  let roe-sum 0
  while [i < 5]
  [
     ifelse i < length All-Previous-ROE
     [
       set roe-sum roe-sum + item i All-Previous-ROE
     ]
     [
```

```
let index length All-Previous-ROE - 1
       set roe-sum roe-sum + item index All-Previous-ROE
     ]
     set i i + 1
  ]
  report roe-sum/5
end
```
## **References**


Easterbrook, Frank H. 1984. Two Agency-Cost Explanations of Dividends. *American Economic Review* 74: 650–59.


Gilbert, Daniel. 2011. Buried by bad decisions. *Nature* 474: 275–77. [CrossRef] [PubMed]

	- *C—Emerging Technology* 64: 86–100. [CrossRef]
