Commit 2a4204c6 authored by Jaromír Plhák's avatar Jaromír Plhák
Browse files

effort change updated

parent c1abea10
Loading
Loading
Loading
Loading
+24 −49
Original line number Diff line number Diff line
@@ -122,15 +122,6 @@ to-report world-size-const
  report 15 ; specifies the size of world
end

to-report constant-effort-limit
  report 0.1  ; change of wage below this value means that it was not changed at all for counting
              ; effort-change
end

to-report effort-change-max
  report 10  ; maximal random change of effort
end

;;;;;; SETUP ;;;;;

to setup
@@ -589,47 +580,31 @@ to go
  ; this is done only when effor change is allowed
  if (ticks mod boss-reaction-time) = 0 and ticks != 0 and not fixed-performance and effort-change [
    ask turtles [
      ifelse abs self-evaluation-real < constant-effort-limit [
        ; in case wage is constant do the random increase or decrease based on emloyee's diligence
          let diff random 1.0 * effort-change-max
          ifelse diligence [
            set effort effort + diff
            set effort-diff diff
          ]
          [
            set effort effort - diff
            set effort-diff -1 * diff
          ]
      ]
      [
      ; W: in case that salary was decreased
        set effort-diff initial-effort * abs self-evaluation-real
      let diff initial-effort * abs self-evaluation-real
      ifelse self-evaluation-real < 0 [
        ifelse effort-diff > 0 [
            ifelse diligence [
              set effort-diff effort-diff / 2
        ; but employee increased his/her effort this month
          set effort-diff diff * (1 - diligence)
          set effort effort - effort-diff
        ]
        [
              set effort effort - effort-diff
            ]
        ; and employee decrease his/her effort this month
          set effort-diff diff * diligence
          set effort effort + effort-diff
        ]
          [
            ifelse diligence [
              set effort effort - effort-diff
      ]
      [
              ; not doing anything here
            ]
          ]

        ; in case that salary was increased
        ifelse effort-diff > 0 [
        ; and employee increased his/her effort this month
          set effort-diff diff * diligence
          set effort effort + effort-diff
        ]
        [
          ; in case that salary was increased - always increase effort
          ; this increase is affected by the current value of effort
          let dist (performance-upper-limit - own-performance) / performance-upper-limit
          set effort-diff effort * abs self-evaluation-real * max list dist 0
          set effort effort + effort-diff
        ; but employee decreased his/her effort this month
          set effort-diff diff * (1 - diligence)
          set effort effort - effort-diff
        ]
      ]
    ]
@@ -826,9 +801,9 @@ end
; the portion of employees with defect strategy. Then the rest is equally divided between
; cooperative strategies - cooperative, tit-for-tat and unforgiving
to setup-generate-diligence
  ifelse random-float 1.0 < initial-diligence
    [ set diligence true ]
    [ set diligence false ]
  set diligence random-normal 0.5 0.175
  if diligence > 1 [ set diligence 1 ]
  if diligence < 0 [ set diligence 0 ]
end