Task allocation & personality

No preview image

1 collaborator

Default-person Mehdi farhangian (Author)

Tags

belbin's team role 

Tagged by Mehdi farhangian over 10 years ago

mbti 

Tagged by Mehdi farhangian over 10 years ago

personality 

Tagged by Mehdi farhangian over 10 years ago

teamwork 

Tagged by Mehdi farhangian over 10 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.4 • Viewed 514 times • Downloaded 38 times • Run 0 times
Download the 'Task allocation & personality ' modelDownload this modelEmbed this model

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


Comments and Questions

Error in running (Question)

I am getting 'Define a breed [AGENTS AGENT] redefines IS-AGENT?, a primitive reporter

Posted about 7 years ago

Click to Run Model

globals [ L F lst sst bb
  f10
  dimension
  db 
  who2
  wholist
  skill-task-list1
  skill-task-list
  cc
  coalition-used
  c
  who1
  cn
  v
  db2
  Ro
  m
  ii
  so
  em cr
  row
  a
  leader
 iii
  final-score4
   final-score
   list-score1
   f10-length 
   f20-length 
   f100
   f20
   m2
   b2
   a2
   c2
   frr
   dimension2
   row2
   f5
   f4
  b
  d
  far 
  ee
  ccc
  cccc
  p1
  a-ex
  a-sens
  f1
  f1-length
  f2-length
  f2
  a-extraverted
  a-feeling
  a-judging
  a-sensing
  ave
  avf
  avj
  avs
  sde
  sdf
  sdj
  sds
  homo
  coalition-used1
  list-score
  score-rank
  fr
  requiements2
  a-score ]
extensions [matrix]

breed [ agents agent ]
breed [ jobs job ]
;breed [ links link ]

;my-skills: Vector which contains a number (0-1) that depicts an agent's performance with a specific skill.
;           *Skills are enumerated.
;W*: list of values from other agents
;S*: list of coalitions from other agents
;joined: the coalition the agent is associated with
agents-own [ my-skills W S joined 
  extraverted
 sensing 
 feeling
 judging
 personality
 Roles
 requirements1
 coalition]

;requirements: Vector of requirements for a job that identifies the need of each skill.
;              *Size determined by num-skills and enumerated in the same manner as my-skills.
;coalition-in-use: As coalitions are associated with a job, they are added to this list for record-keeping
jobs-own [ requirements coalition-in-use 
  Routin 
  Creativity
  Emergency
  Sociality
  Complexity  
  bbb 
  
   score
   score2
   hh
   final-score1
   final-score2
   final-score3
   f3 
   lscore
   cscore
   oscore
   uscore
   u1score
   vscore
   Roscore
   crscore
   emscore
   soscore
   coscore
   efficiency]

;L: global list of coalitions

to setup
  ;; (for this model to work with NetLogo's new plotting features,
  ;; __clear-all-and-reset-ticks should be replaced with clear-all at
  ;; the beginning of your setup procedure and reset-ticks at the end
  ;; of the procedure.)
  __clear-all-and-reset-ticks
  set coalition-used [] 
  create-jobs num-jobs
  create-agents num-agents
  setup-jobs
  setup-agents
  setup-L
  ask jobs [ set f3 f ] 
end 

to find-co
  
  set f5 []
  set who1 [] 
  set who1 [who] of jobs

   set final-score4 []
 ask jobs [without-interruption [ 
     set final-score1 []
     set  list-score1 [] 
      set skill-task-list1 []
     set list-score [] 
      set bb[]

 update-f
      set who2 who  
     
     set skill-task-list1 sort-by > requirements
   
  set cc first skill-task-list1
  set cn position cc requirements
  
  set requiements2 requirements
ask agents [  set requirements1  requiements2]

if not empty? f3 [
     set m matrix:from-row-list f3
     set dimension  matrix:dimensions m
 set row first dimension
      

     while [ii < row ]
 [ 
 set a matrix:get-row m ii
 
set p1 [] 
set wholist []
set bbb[]
 foreach a [ set bbb  a set score 0
set lscore 0
     set p1 []
foreach bbb [ask agent ? [set p1 fput personality p1 ] ]
     
foreach bbb [ask agent ? [   if  item cn my-skills  > 4 and 
     extraverted < 50  and sensing > 50 and feeling > 50 and judging < 50 or 
            item cn my-skills  > 4 and  extraverted < 50 and sensing < 50 and feeling > 50 and judging < 50 or 
            item cn my-skills  > 4 and extraverted > 50 and sensing > 50 and feeling < 50 and judging > 50  or 
           item cn my-skills  > 4 and extraverted > 50 and sensing < 50 and feeling < 50 and judging > 50 
  [ set leader leader + 1  ]]]

 
  ; skills
 if leader != 0 [ set lscore 1  ]
  
   foreach bbb [ask agent ? [ set c (map [?1 < ?2] my-skills requirements1)
    foreach c [ if ? = true [set requirements1 replace-item (position ? c ) requirements1 0  set c (map [?1 < ?2] my-skills requirements1 )]]
      set f10 [] 
 set d filter [ ? > 0] requirements1
set f10 fput (length d ) f10
set ee first sort-by >  f10]]
if ee = 4 [ set cscore   4]
if ee = 3 [ set cscore  2 ]
if ee = 2 [ set cscore  1]
if ee = 0 [ set cscore 0 ] 

   

;minimize overqualification
foreach bbb [ ask agent ? [set cc (map [?1 - ?2]  my-skills requirements1)]]

set ccc [] 
    foreach cc [ ifelse ? < 0 
      [set ? 0 set ccc lput  ? ccc ]
      [set ccc lput ? ccc ]]
    
set cccc sum ccc 
set oscore  (  cccc / 200) 
; minimizing conflict of roles
; shaper and planet 
; ISFP and INFP

set uscore 0
; one shaper and one plant 
; shaper is ISFP or INFP
;plant is INFJ or INTJ
 if member? "ISFP" p1 and member? "INFJ"  p1 [set uscore uscore +  0.1 ]
  if member? "INFP" p1 and member? "INFJ" p1  [set uscore uscore +  0.1]
  
  if member? "ISFP" p1 and member? "INTJ" p1 [ set uscore uscore +  0.1]
  if member? "INFP" p1 and member? "INTJ" p1 [set uscore uscore +  0.1]
  
  ; specialist and planet 
  ; Specialist is ISTP INTP
  ; Planet is INFJ or INTJ 
  
  if member? "ISTP" p1 and member? "INFJ" p1 [set uscore uscore +  0.1]
  if member? "INTP" p1 and member? "INFJ" p1 [set uscore uscore +  0.1]
  
  if member? "ISTP" p1 and member? "INTJ" p1 [set uscore uscore +  0.1]
  if member? "INTP" p1 and member? "INTJ" p1 [set uscore uscore +  0.1]
  
  
  ; ME and completer 
  ; ME ISFJ,ISTJ 
  ;Completer ESTP,ESFP 
  
   
    if member? "ISFJ" p1 and member? "ESTP" p1[ set uscore uscore +  0.1]
    if member? "ISTJ" p1 and member? "ESTP" p1 [ set uscore uscore +  0.1]
    
    if member? "ISFJ" p1 and member? "ESFP" p1 [ set uscore uscore +  0.1]
    if member? "ISTJ" p1 and member? "ESFP" p1 [set uscore uscore +  0.1]
    
    ; Completer and Resource Investigator 
    ; Completer ESTP,ESFP
    ; Resource Investigator ENFP, ENTP 
     
    if member? "ENFP" p1 and member? "ESTP" p1 [set uscore uscore +  0.1]
    if member? "ENTP" p1 and member? "ESTP" p1 [set uscore uscore +  0.1]
    
    if member? "ENFP" p1 and member? "ESFP" p1 [set uscore uscore +  0.1]
    if member? "ENTP" p1 and member? "ESFP" p1 [set uscore uscore +  0.1]
    
  ; shaper and chairman ( coordinator) 
; shaper is ISFP or INFP
; coordinator is ESTJ or ENTJ 
if member? "ISFP" p1 and member? "ESTJ"  p1 [set uscore uscore +  0.1]
  if member? "INFP" p1 and member? "ESTJ" p1 [ set uscore uscore +  0.1]
  
  if member? "ISFP" p1 and member? "ENTJ" p1 [set uscore uscore +  0.1]
  if member? "INFP" p1 and member? "ENTJ" p1 [set uscore uscore +  0.1]
    
    ; shaper and teamworker 
    ; shaper is ISFP or INFP
    ;teamworker ESFJ and ENFJ 
    
    if member? "ISFP" p1 and member? "ESFJ"  p1 [set uscore uscore +  0.1]
  if member? "INFP" p1 and member? "ESFJ" p1  [set uscore uscore +  0.1]
  
  if member? "ISFP" p1 and member? "ENFJ" p1 [set uscore uscore +  0.1]
  if member? "INFP" p1 and member? "ENFJ" p1 [set uscore uscore +  0.1]
     

    ; minimize conflict of similar roles 
    set fr [] 
  foreach bbb [ ask agent ? [  set fr fput roles  fr 
    set f1 reduce sentence fr 
    set f1-length length  f1 
    set f2 remove-duplicates f1 
    set f2-length length  f2 
  ]]
     set u1score   ((f1-length - f2-length ) / 10 )
 
     ; maximize diversity of roles
     set vscore  ( f2-length / 10 ) 

     ; personality and task characteristic 
     set a-extraverted [] 
     set a-feeling [] 
     set a-judging [] 
     set a-sensing [] 
  foreach bbb [ ask agent ? [set a-extraverted fput extraverted a-extraverted 
 set  a-feeling fput feeling a-feeling 
 set  a-judging fput judging a-judging 
  set a-sensing fput sensing a-sensing 
  ]]
; calculate heteroginity and homoginity 

 set ave  mean a-extraverted
  set avf  mean a-feeling 
  set avj  mean a-judging
  set avs  mean a-sensing
  set sde  standard-deviation a-extraverted
  set sdf  standard-deviation a-feeling
  set sdj  standard-deviation a-judging 
  set sds  standard-deviation a-sensing 
  
  set homo (sde + sdf + sdj + sds ) / 4 

if Routin > 50 and  homo > 20 [set Roscore  0.2 ]

if Routin < 50 and  homo < 20 [set Roscore  0.2 ]

if creativity > 50 and avs < 50 [set crscore  0.2] 

if emergency  > 50 and avj < 50 [set emscore  0.2 ]

if sociality > 50 and ave > 50 [set soscore  0.2 ]

if complexity > 50 and avf < 50 [set coscore  0.2] 


; constraints
  set frr [] 
  foreach bbb [ ask agent ? [  set frr fput personality  frr 
    
  ]]
  
  
Set Ro 0 
; IMP"
if Routin > 80 [
foreach bbb [ ask agent ? [
 if not member? "ISTJ" frr or not member? "ESTJ" frr or not member? "ISFJ" frr  or not member? "ESFJ" frr [set Ro Ro + 1]]]
If Ro = 0 [set score 0 ]]






set ii ii + 1

 ] 
 
 set score   lscore + cscore - oscore - uscore - u1score + vscore + Roscore + crscore + emscore + soscore + coscore 
 set score2   lscore + cscore - oscore - uscore - u1score + vscore + Roscore + crscore + emscore + soscore + coscore 
 Set cr 0
;"PLANT"
if creativity > 80 [
foreach bbb [ ask agent ? [
 if not member? "INTJ" frr  or not member? "ENTJ" frr or not member? "INFJ" frr or not member? "ENFJ" frr [set cr cr + 1]]]
If cr = 0 [set score 0 ]]


;"COMPLETER"

Set em 0 
if  emergency > 80 [
  foreach bbb [ ask agent ? [ 
 if not member?   "ISTP" frr or not member? "ESFP" frr or not member?  "ISFP" frr  or  not member? "ESTP" frr [set em em + 1]]]
  If em = 0 [set score 0 ]]



set so  0 
; "RI"  
if sociality  > 80 [
  foreach bbb [ ask agent ? [ 
  if  not member?  "INTP" frr or not member?  "INFP" frr or  not member? "ENFP" frr or  not member? "ENTP" frr [set so so + 1]]]
  If so = 0 [set score 0 ]]




  set final-score1 fput (list(a) score2 score) final-score1
  
]
 



;;
 
 set bbb [] set ii 0 set final-score1 remove-duplicates final-score1

set final-score1 sort-by [ last ?1 > last ?2 ] final-score1

set final-score2 first final-score1 
set final-score3 first  final-score2
set score last final-score2
set efficiency item 1 final-score2

set final-score4 fput final-score3 final-score4
set final-score4 remove-duplicates final-score4

 foreach final-score3 [ask agent ? [create-link-with job who2  set coalition  "used" ]]
  
set final-score4 reduce sentence final-score4

]
set db 0
 set a-score []
ask jobs [ set a-score fput efficiency a-score ] 
 set db sum  a-score
 set db2 db / num-jobs 
 ]
 ]
end 

to setup-jobs
  output-show "requirements:"
  ask jobs [
    set coalition-in-use []
    set label coalition-in-use
    set requirements  build-required-list-randomly 
    set shape "box"
    set size 2
    set color color + random 5 ;make it darker for readability
    set xcor ceiling(who - num-agents / 2 ) * (-1)^(who)
    set ycor 13
    output-show requirements ]
  ask jobs 
  [ set Routin random 100
    set creativity random 100
    set emergency random 100
    set sociality random 100 
     set  complexity random 100
  ]
end 

to setup-agents
  output-show "Skills:"
  ask agents [ 
    set my-skills  build-skill-list-randomly  
    set W []
    set S []
    set label who
    set joined []
    set shape "person"
    set color  color + random 5 
    set size 2
    set xcor  ceiling((who - num-agents / 2) / 2) * (-1)^(who)
    set ycor -13
    output-show my-skills ]
  ask agents[ 
    set extraverted         random  100
  set feeling         random 100
  set judging        random  100
 set sensing        random  100
if extraverted <= 50 and sensing <= 50 and feeling <= 50 and judging <= 50 [set personality "INTP"]
if extraverted  <= 50 and sensing <= 50 and feeling <= 50 and judging > 50 [set personality "INTJ"]
if extraverted <= 50 and sensing <= 50 and feeling > 50 and judging <= 50 [set personality "INFP"]
if extraverted <= 50 and sensing > 50 and feeling <= 50 and judging <= 50 [set personality "ISTP"]
if extraverted  > 50 and sensing <= 50 and feeling <= 50 and judging <= 50 [set personality "ENTP"]
if extraverted <= 50 and sensing > 50 and feeling <= 50 and judging > 50 [set personality "ISTJ"]
if extraverted > 50 and sensing <= 50 and feeling <= 50 and judging > 50 [set personality "ENTJ"]
if extraverted <= 50 and sensing > 50 and feeling > 50 and judging > 50 [set personality "ISFJ"]
if extraverted > 50 and sensing > 50 and feeling <= 50 and judging > 50 [set personality "ESTJ"]
if extraverted > 50 and sensing > 50 and feeling > 50 and judging <= 50 [set personality "ESFP"]
if extraverted <= 50 and sensing > 50 and feeling > 50 and judging <= 50 [set personality "ISFP"]
if extraverted > 50 and sensing > 50 and feeling > 50 and judging > 50 [set personality "ESFJ"]
if extraverted <= 50 and sensing <= 50 and feeling > 50 and judging > 50 [set personality "INFJ"]
if extraverted > 50 and sensing > 50 and feeling <= 50 and judging <= 50 [set personality "ESTP"]
if extraverted > 50 and sensing <= 50 and feeling > 50 and judging <= 50 [set personality "ENFP"]
if extraverted > 50 and sensing <= 50 and feeling > 50 and judging > 50 [set personality "ENFJ"]
  ]
  
; roles
ask agents 
[ 
  if personality = "INTP" [set roles [ "Specialist" "RI"] ]                            
  if personality = "INTJ" [set roles  ["Plant"  "Coordinator" ] ]                 
  if personality = "INFP" [set roles [ "Shaper" "RI"] ]                          
  if personality = "ISTP" [set roles [ "Specialist" "Completer"]]
  if personality = "ENTP" [set roles [ "RI" "Specialist"]]
  if personality = "ISTJ" [set roles [ "ME" "Coordinator" "IMP"]]
  if personality = "ENTJ" [set roles [ "Coordinator" "Plant"]]
  if personality = "ISFJ" [set roles [ "ME" "IMP" "Coordinator" ]]
  if personality = "ESTJ" [set roles [ "Coordinator" "ME" "IMP"]]
  if personality = "ESFP" [set roles [ "Completer" "Shaper"]]
  if personality = "ISFP" [set roles [ "Shaper" "Completer"]]
  if personality = "ESFJ" [set roles [ "TW" "ME" "IMP"]]
  if personality = "INFJ" [set roles [ "Plant" "TW"]]
  if personality = "ESTP" [set roles [ "Completer" "Specialist" ]]
  if personality = "ENFP" [set roles [ "RI" "Shaper"]]
  if personality = "ENFJ" [set roles [ "TW" "Plant"]]
  
]
end 

to setup-L
  set L []
  ask agents [ set L lput (list who) L ] ;add the single agent sets to L
  repeat num-agents [
    ask agents [
      without-interruption [
        foreach L [ 
          if( (not member? who ?) ) [ set L lput (sort(lput who ?)) L ]
          set L remove-duplicates L] ] ] ]
          set f filter [ length ? = Team-number ] L
          
  ; l is all the combinations 
end 

to-report build-skill-list-randomly
  set lst[]
   repeat num-skills [ set lst lput (random 10) lst ] 
  report lst
end 

to-report build-required-list-randomly
  set sst[]
   repeat num-skills [ set sst lput (random 10) sst ] 
  report sst
end 

to update-f
  set f3 []

 set m2 matrix:from-row-list f
     set dimension2  matrix:dimensions m2
 set row2 first dimension2
      
     while [iii < row2 ]
 [ 
 set a2 matrix:get-row m2 iii
set f4 filter [ member? ? final-score4] a2 
  
if  empty? f4 [  set f3 fput a2 f3   ] 

set f3 remove-duplicates f3 

 set iii iii + 1 
 
 ]

 set iii 0
end  
;find-coalition algorithm.

There is only one version of this model, created over 10 years ago by Mehdi farhangian.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.