team affect
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
globals [ imported-jobs ;;an indicator whether the csv data file import was successful time ;;tracks the simulation time in hours, while every tick represents five minutes. global-affect ;;mean affect of links, between 0 and 1 global-reciproticy ;;mean reciprocity, between 0 and 1 reciprocity-01 reciprocity-02 reciprocity-03 reciprocity-12 reciprocity-13 reciprocity-23 ] turtles-own [ role ;;personality extraversion conscientiousness emotional_stability agreeableness openness ;;need to import individual differences collected from HERA ;; current code does not incorporate personalities ] links-own [ affect ;;affect values for each link, ranging 0<=affect<=1 ] extensions[csv] breed [jobs job] ;;have a task importer where things you want to knwo about a job are defined and set ;;make a csv first column is when task is introduced, task duration, four columns for each hera member ;;comment code jobs-own[ start-time duration assigned-to-CMD assigned-to-FE assigned-to-MS1 assigned-to-MS2 visible ] ;; Routine for the ABM Simulation setup to setup clear-all set time 0 setup-agents setup-links reset-ticks set imported-jobs False end ;;Creates the four agents for the model: CMD, FE, MS1, MS2 to setup-agents create-turtles 1 [ set role "CMD" set shape "astronaut" set size 4 set color white set xcor 0 set ycor 9 ] ask patch 1 5 [ set plabel "CMD" ] create-turtles 1 [ set role "FE" set shape "astronaut" set size 4 set color white set xcor 0 set ycor -9 ] ask patch 0.3 -5 [ set plabel "FE" ] create-turtles 1 [ set role "MS1" set shape "astronaut" set size 4 set color white set xcor -9 set ycor 0 ] ask patch -5 0 [ set plabel "MS1" ] create-turtles 1 [ set role "MS2" set shape "astronaut" set size 4 set color white set xcor 9 set ycor 0 ] ask patch 6 0 [ set plabel "MS2" ] end ;; Creates the setup for all links for the model to setup-links ;ask all turtles to create a link to every other turtle that's not itself ask turtles with [who != 0][ create-link-to turtle 0 ] ask turtles with [who != 1][ create-link-to turtle 1 ] ask turtles with [who != 2][ create-link-to turtle 2 ] ask turtles with [who != 3][ create-link-to turtle 3 ] ask links [ ;;set color rgb 255 0 0 set color approximate-hsb 0 90 70 set shape "curvy" set thickness 0.2 ] end ;; The main simulation routine for the program to go ;;randomly sets affect values of links import-jobs ask links [ set affect (affect + random-float .25 - random-float .20) if affect > 1 [set affect 1] if affect < 0 [set affect 0] ] ;;colors network links based upon affect values ask links [ ;;set color rgb (255 - 255 * affect) (55 + 200 * affect) 0 set color approximate-hsb (affect * 140) 90 70 ] ;;colors astronauts who are on the same task ask turtles with [who = 0 or who = 1 or who = 3][ ifelse (random-float 1 < 0.5) [set color white] [ifelse (random-float 1 < 0.7) [set color 87] [ifelse (random-float 1 < 0.8) [set color 57] [set color 137]]] ] ;;resets global variables set time (time + 1 / 12) set global-affect (([affect] of link 0 1 + [affect] of link 0 2 + [affect] of link 0 3 + [affect] of link 1 0 + [affect] of link 1 2 + [affect] of link 1 3 + [affect] of link 2 0 + [affect] of link 2 1 + [affect] of link 2 3 + [affect] of link 3 0 + [affect] of link 3 1 + [affect] of link 3 2) / 12) set reciprocity-01 abs ([affect] of link 0 1 - [affect] of link 1 0) set reciprocity-02 abs ([affect] of link 0 2 - [affect] of link 2 0) set reciprocity-03 abs ([affect] of link 0 3 - [affect] of link 3 0) set reciprocity-12 abs ([affect] of link 1 2 - [affect] of link 2 1) set reciprocity-13 abs ([affect] of link 1 3 - [affect] of link 3 1) set reciprocity-23 abs ([affect] of link 2 3 - [affect] of link 3 2) tick end ;; A subroutine for importing jobs from csv to import-jobs ;; open a file on the system let filename "CrewSchedule.csv" file-open filename ;; parses the file let header csv:from-row file-read-line while [ not file-at-end? ] [ let items csv:from-row file-read-line create-jobs 1 [ hide-turtle ;; make the tasks have a square shape set shape "square" set start-time item 0 items set duration item 1 items set assigned-to-CMD item 2 items set assigned-to-FE item 3 items set assigned-to-MS1 item 4 items set assigned-to-MS2 item 5 items ;; not visible until (ticks = introduction-time) set xcor 0 set ycor 0 ] ] ;; import complete, so close the file file-close set imported-jobs true end
There is only one version of this model, created over 9 years ago by Jacqueline Ng.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
CrewSchedule.csv | data | Crew schedule | over 9 years ago, by Jacqueline Ng | Download |
Revised Final Project Proposal_v2.docx | word | Design document | over 9 years ago, by Jacqueline Ng | Download |
This model does not have any ancestors.
This model does not have any descendants.