Kellogg 0

No preview image

1 collaborator

Default-person Eleanor Anderson (Author)

Tags

(This model has yet to be categorized with any tags)
Part of project 'Organizational Change Set'
Model group MAM-2013 | Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.4 • Viewed 311 times • Downloaded 30 times • Run 0 times
Download the 'Kellogg 0' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model


turtles-own 
 [ opinion
   service
   arrival-time
   leaving-time
   scut-work
   night-float?
   rounding?
   ]
 
 ;; note this doesn't give people a day off at all yet

patches-own [doctors-here]

breed [chiefs chief]
breed [seniors senior]
breed [interns intern]
;breed [dropped-balls dropped-ball]


;; Create doctors at 3 levels of hierarchy (differentiated by shape).
;; Give them opinions about whether the status quo should be defended or reformed

to setup
  clear-all
  
  create-chiefs 5 
  [ ;set opinion one-of ["defender" "reformer"] 
    set shape "star"
    set size 1.3 ]
  create-seniors 15
  [ ;set opinion one-of ["defender" "reformer"]
    set shape "pentagon" ]
  create-interns 20
  [ ;set opinion "reformer"
    set shape "x"  ]

ask turtles
 [ setxy random-xcor random-ycor
   set rounding? false
   set night-float? false
   set scut-work []
   reset-daily-schedule ]

;  ask patches
;  [ set doctors-here count turtles-here + count turtles-on neighbors ]

  assign-chiefs&seniors
  assign-interns
  
;  assign-intern-work
  
  reset-ticks
  tick-advance 6 
end 


;; monthly service assignments

to assign-chiefs&seniors
  ask turtles
  [ set service 0 
    set night-float? false]
  ask n-of 4 chiefs
  [ rotate 1 chiefs ]
  ask n-of 4 seniors
  [ set night-float? true 
    rotate 1 seniors ]
  ask n-of 4 seniors with [night-float? = false ]
  [ rotate 2 seniors ] 
  ask seniors
  [ reset-daily-schedule ]
end 

to assign-interns
  ask interns
    [ set service 0 ]
    ask n-of 4 interns
    [ rotate 1 interns ] 
end 

to rotate [num pos]
 set service ( 1 + random 4 )
 if count other pos with [ service = [ service ] of myself] >= num
 [ rotate num pos ]
end 


;; daily arriving and leaving times, according to position

to reset-daily-schedule
if is-chief? self
[ set arrival-time 6
  set leaving-time 19 ]
if is-senior? self
[ set arrival-time 6
  set leaving-time 19 ]
if [ night-float? ] of self = true
[ set arrival-time 18
  set leaving-time 7 ]
if is-intern? self
[ set arrival-time 6
  set leaving-time 19 ]
end 

to go
  
;; long term schedules:
  monthly-schedule
  daily-schedule
  
;; each hour (ie tick):  
  complete-tasks
  move
  
  tick
end 

to monthly-schedule

  ;; every 4 weeks (counting only 6 days to a week, interns switch services
  if ticks mod 576 = 0
  [assign-interns]
  
  ;; every 8 weeks, chiefs & seniors switch services (really some seniors should switch every 6 . . .)
  if ticks mod 1152 = 0
  [assign-chiefs&seniors]
end 

to daily-schedule
  
  ;; each turtle shows up and leaves according to its arrival and leaving times
  ;; when turtles arrive they assess whether what they did yesterday worked and decide what to do accordingly
  ask turtles
  [ if ticks mod 24 = arrival-time
  [ show-turtle 
    take-over ]
    if ticks mod 24 = leaving-time
    [ hand-off
      hide-turtle ] ]
  
  ;; I'm not sure I want a pre-set leaving time ...I think I might want leaving to be a behavior that happens according to the model;
  ;; I think this can do that, since it updates every tick
  
  ;; every morning when the chiefs and seniors (and interns?) come in at 6,
  ;; the interns' new tasks are assigned (not really, but that's ok for now)
  if ticks mod 24 = 6
  [ assess-strategy 
    assign-intern-work ]
;    report hours ]
  
  ;; at 5pm, chiefs gather their teams for afternoon rounds
  if ticks mod 24 = 17
  [ ask chiefs with [service != 0 ]
    [pick-rounds-spot ] ]
  
  ;; afternoon rounds happen between 5 and 7pm (I don't think they really take 2 hours in the hospital, but this gives a chance to
  ; see it in the animation
  if ticks mod 24 > 16 and ticks mod 24 < 19
    [ ask turtles with [service != 0  and hidden? = false and rounding? = false]
      [ set rounding? true ]
      ask turtles with [ rounding? = true ]
       [ afternoon-rounds ] ]
   
   ;; at 7pm rounds are over, and interns "should" be handing off routine work to night floats 
    if ticks mod 24 = 19
    [ ask turtles with [rounding? = true ]
      [ set rounding? false ] ]
end 

to assess-strategy
ask turtles with [ service != 0 ]
  [ let dropped-balls [ scut-work ] of turtles with [ service = [ service ] of myself ]
    set dropped-balls ( reduce sentence dropped-balls )
    ;show dropped-balls
    if dropped-balls != []
    [ ;show "problem!"
     assign-blame
      change-strategy ] ]
end 

to assign-blame
end 

;; Bleggggh how to do this???

to change-strategy
  if is-intern? self
  [ select-strategy ]
;    if scut-work = [] 
;    [ set leaving-time ticks mod 24 ] ]
end 

to select-strategy
  let strategy random 2
  if strategy = 0 
   [ set leaving-time leaving-time + 1 ]
  if strategy = 1
    [ set arrival-time arrival-time - 1 ] 
end 

to take-over
ask interns with [ service != 0 ]
  ;; takeover what's left from the night before
  [ let my-float one-of turtles with [service = [service] of myself and night-float? = true ] 
    set scut-work sentence scut-work [scut-work] of my-float
    ask my-float [ set scut-work [] ] ] 
end 

to assign-intern-work
  ask interns with [ service != 0 ]
  
  ;; add the day's responsibilities
   [ set scut-work sentence scut-work [ 1 2 3 4 5 6 7 8 9 0 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ] ] 
end 

to complete-tasks
  ask turtles with [ scut-work != [] and hidden? = false]
  [ set scut-work remove first scut-work scut-work ] 
end 

to move
  ask turtles
  [ if hidden? = false and rounding? = false
    [ rt random 45
      lt random 45
      fd .5] ] 
end 

to afternoon-rounds
;  if ticks mod 24 = 17
;  [ pick-spot ]
;  interact
;
end 

to pick-rounds-spot
  ifelse privacy = true
     [ move-to min-one-of patches [doctors-here] ]
     [ move-to max-one-of patches [doctors-here] ]
    ask other turtles with [service = [service] of myself ]
    [ move-to one-of [neighbors] of [ patch-here ] of myself] 
end 

to interact
end 

to hand-off
  ask interns with [ service != 0 ]
    [ ask one-of turtles with [service = [service] of myself and night-float? = true ]
      [set scut-work sentence scut-work [scut-work] of myself] 
    set scut-work [] ] ;]
end 

to-report current-time
  let hours ticks mod 12
  if hours = 0
  [ set hours 12 ]
  let am-pm "am"  
  if 1 + ticks mod 24 > 12 
  [ set am-pm "pm" ] 
  report word hours am-pm
end 


;to-report hours
;  ask interns
;  [ if hidden? = false ]
;  [ set daily-hours daily-hours + 1 ]
;  
;  
;end


;; how 'bout this:

;; every time there's a handoff, there's also a % chance of a dropped ball;
;; someone 



; set service number-groups
;      set number-groups number-groups - 1  
;  if number-groups < 0 
;  [ set number-groups count chiefs ] 
;end


;to go
;  wiggle
;  call-team
;  pick-spot
;  assess-expectations
;  find-influencers
;  be-influenced
;  adjust-appearance
;  tick
;end
;
;;; When they are not doing rounds, let doctors walk around the hospital randomly
;

;
;;; Show doctors' opinions and actions in their color and size
;
;to adjust-appearance
;  ask turtles
;  [ if opinion = "defender"
;    [ set color blue - 2]
;   if opinion = "reformer"
;    [ set color blue + 2 ]
;   if action = "shorter hours"
;    [ set size 1.5 ]
;   if action = "long hours"
;    [ set size 2 ]
;     ]
;  
;end
;
;
;  
;;  [ ask n-of group-size turtles with [ current-group = 0 ]
;;    [ set current-group number-groups ]
;;    set leaders (turtle-set leaders (one-of turtles with [current-group = number-groups ]) )
;;    set number-groups number-groups - 1 ]
;;  ask turtles with [ current-group = 0 ]
;;  [ die ]
;;  
;;  layout-circle chiefs 13
;;  ask chiefs
;;  [ ask patch-here 
;;    [ set group-center [ current-group ] of myself ] ]
;;  ask turtles
;;  [ join ]
;
;;end
;
;;to join
;;   move-to one-of patches with [group-center = [ current-group ] of myself ]
;;   bk 2
;;end
;
;
;
;
;;; Put together a team of 1 chief, 3 seniors and 4 interns who will work together
;
;;to call-team
;;  ask turtles [ set rounding? false ]
;;  ask one-of chiefs [set rounding? true]
;;  ask n-of 3 seniors [set rounding? true]
;;  ask n-of 4 interns [set rounding? true]
;;end
;
;;; As the chief to pick a spot for them to conduct rounds
;;; If privacy is true they try to pick a spot without other people around
;;; If privacy is false they pick a spot with lots of other doctors around
;

;
;;; Ask interns and seniors to assess the expectations of their superiors, and set their actions accordingly
;;; If anyone of higher status expects them to work long hours, they will do so
;;; Otherwise they'll follow their own opinion
;
;to assess-expectations
;  ask interns with [ rounding? = true ]
;  [ ifelse any? chiefs in-radius 3 with [ opinion = "defender" ]
;    [ set action "long hours"]
;    [ ifelse any? seniors in-radius 3 with [ opinion = "defender" ]
;      [ set action "long hours"]
;      [ enact-own-opinion ] ] ]
;  ask seniors with [ rounding? = true ]
;  [ ifelse any? chiefs in-radius 3 with [ opinion = "defender" ]
;    [ set action "long hours"]
;    [ enact-own-opinion ] ]
;end
;
;to enact-own-opinion
;  if opinion = "defender" 
;  [ set action "long hours"]
;  if opinion = "reformer"
;  [ set action "shorter hours"] 
;end
;
;;; Let doctors have their minds changed by those they interact with on rounds
;;; Doctors are influenced by those of the same or higher status
;;; Chiefs are only influenced if everyone they're working with on a shift came in 
;; already working in the reform way (ie with shorter hours)
;
;to be-influenced
;  ask turtles with [ rounding? = true and influencers != 0 ]
;  [ if count influencers with [ opinion = "reformer" ] > count influencers with [ opinion = "defender" ]
;    [ set opinion "reformer" ]
;    if count influencers with [ opinion = "reformer" ] < count influencers with [ opinion = "defender" ]
;    [ set opinion "defender" ] ]
;  ask chiefs with [ rounding? = true ]
;   [ if count turtles with [ rounding? = true and action = "shorter hours"] = count turtles with [rounding? = true ]
;     [ set opinion "reformer" ] ]
;  
;end
;
;
;to find-influencers
;  ask turtles 
;  [ if is-intern? self
;    [ set influencers (turtle-set chiefs with [ rounding? = true ] seniors with [ rounding? = true ] interns with [rounding? = true]) ] 
;    if is-senior? self
;    [ set influencers (turtle-set chiefs with [ rounding? = true ] seniors with [ rounding? = true ] ) ] ]
;end




;to service-setup
;  let number-groups count chiefs
;   ask chiefs 
;    [ set service number-groups
;      ask n-of 2 seniors
;      [ set service number-groups ]
; ;       join ]
;      ask one-of interns
;      [ set service number-groups ]
; ;       join ] 
;      set number-groups number-groups - 1 ] 
;  
;  
;end
;
;to network-setup
;  build-formal-ties
;  build-informal-ties
;end
;
;
;to build-formal-ties
;  ;; create formal, directed ties between people on the same service
;  ;; the higher status people give orders, the lower people follow them
;  
;  
;end
;
;
;to build-informal-ties
;  ;; create informal positive ties among people at similar status levels who have similar opinions about the reform
;  ;; create informal positive directed links bewteen high status people and underlings who do what they want them to
;  ;; create informal negative directed inks between high status people and underlings who implement the reform??
;  
;  
;  
;end  


;to go
;  switch-services
;  act
;  interact
;  
;  tick
;end
;

;
;
;to act
;  
;  
;end
;
;
;to interact
;  
;  
;end



;to arrive
;  ask turtles
;  [ if current-time = arrival-time 
;  [ show-turtle ] ]
;end


;to leave
;  ask turtles
;  [ if current-time = leaving-time
;    [ hide-turtle ] ]
;end

There are 3 versions of this model.

Uploaded by When Description Download
Eleanor Anderson almost 11 years ago hours ticks, intern tasks, hours change based on dropped balls Download this version
Eleanor Anderson almost 11 years ago A model that runs (though it doesn't match reference pattern) Download this version
Eleanor Anderson almost 11 years ago Initial upload Download this version

Attached files

File Type Description Last updated
EleanorAnderson_ 6 03 13.docx word project update 6 3 13 almost 11 years ago, by Eleanor Anderson Download
project update 5 18 13.docx word Update 5 18 13 almost 11 years ago, by Eleanor Anderson Download

This model does not have any ancestors.

This model does not have any descendants.