The Garbage Can Model of Organizational Choice
Model was written in NetLogo 5.0.4
•
Viewed 897 times
•
Downloaded 49 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Click to Run Model
;; THE GARBAGE CAN MODEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Variables declaration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; globals [ ;; Agents available for decision-making free-participants ;; cumulative number of non-blocked participants ave-free-participants ;; average number of non-blocked participants free-opportunities ;; cumulative number of non-blocked opportunities ave-free-opportunities ;; average number of non-blocked opportunities free-solutions ;; cumulative number of non-blocked solutions ave-free-solutions ;; average number of non-blocked solutions free-problems ;; cumulative number of non-blocked problems ave-free-problems ;; average number of non-blocked problems ;; Kinds of decision-making and kinds of flights. num-oversight ;; cumulative number of decisions by oversight num-blocked-oversight ;; cumulative number of decisions by oversight following a blocked decision process num-resolution ;; cumulative number of decisions by resolution num-blocked-resolution ;; cumulative number of decisions by resolution following a blocked decision process num-postponement ;; cumulative number of flights by postponement num-buck-passing ;; cumulative number of flights by buck-passing ;; Blocked decisions, postponed problems, passed problems. num-blocked ;; cumulative number of blocked decision processes ave-num-blocked ;; average number of blocked decision processes size-blocked ;; cumulative size of blocked decision processes ave-size-blocked ;; average size of blocked decision processes life-blocked ;; cumulative lives of blocked decision processes ave-life-blocked ;; average life of blocked decision processes num-postponed ;; cumulative number of postponed problems ave-num-postponed ;; average number of postponed problems life-postponed ;; cumulative lives of pairs opportunity-problem ave-life-postponed ;; average life of pairs opportunity-problem num-passed ;; cumulative number of passed problems ave-num-passed ;; average number of passed problems life-passed ;; cumulative lives of pairs participant-problem ave-life-passed ;; average life of pairs participant-problem ;; The counters of meetings with already-met opportunities, solutions and problems. meetings-known-opp meetings-opp meetings-known-sol meetings-sol meetings-known-pro meetings-pro ;; These are necessary in order to impose decision structure and access structure. arrivals-departures_par ;; the number of arrivals minus the number of departures of participants arrivals-departures_opp ;; the number of arrivals minus the number of departures of opportunities arrivals-departures_sol ;; the number of arrivals minus the number of departures of solutions arrivals-departures_pro ;; the number of arrivals minus the number of departures of problems ;; Indicators of decision-making by oversight and resolution at different hierarchical levels. countOveHigh ;; the number of oversights making use of opportunities at high hierarchical levels countOveLow ;; the number of oversights making use of opportunities at low hierarchical levels countResHigh ;; the number of resolutions making use of opportunities at high hierarchical levels countResLow ;; the number of resolutions making use of opportunities at low hierarchical levels ] patches-own [pcolor-white-since] ;; since when it hosts a blocked decision process turtles-own [blocked?] ;; whether an agent is allowed to move breed [solution] breed [opportunity] breed [participant] breed [problem] participant-own [ participant_id ;; the identification number of participants ability ;; the ability of participants charged? ;; eventually, this participant is charged... with-problem ;; ...with this problem encountered ;; the agents this participant has already met ] opportunity-own [ opportunity_id ;; the identification number of opportunities charged? ;; eventually, this opportunity is charged... with-problem ;; ...with this problem ] solution-own [ solution_id ;; the identification number of solutions efficiency ;; the efficiency of solutions ] problem-own [ problem_id ;; the identification number of problems difficulty ;; the difficulty of problems postponed? ;; eventually, this problem has been postponed... to-opportunity ;; ...to this opportunity passed? ;; eventually, this problem has been passed... to-participant ;; ...to this participant since ;; when the flight began ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;; What is done when the "Setup" button is pressed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all reset-ticks ;; Initializes the counters of the variations of the number of agents. set arrivals-departures_par 0 set arrivals-departures_opp 0 set arrivals-departures_sol 0 set arrivals-departures_pro 0 ;; Initializes the counters of agents avaiilable for decision-making. set free-participants 0 set free-opportunities 0 set free-solutions 0 set free-problems 0 ;; Initializes the number of kinds of decision-making and flights. set num-oversight 0 set num-blocked-oversight 0 set num-resolution 0 set num-blocked-resolution 0 set num-postponement 0 set num-buck-passing 0 ;; Initializes the number of blocked decisions, the number of postponed problems and the number of passed problems. set num-blocked 0 set size-blocked 0 set life-blocked 0 set num-postponed 0 set life-postponed 0 set num-passed 0 set life-passed 0 ;; Initializes the counters of the meetings with opportunities, solutions and problems that had already been met. set meetings-known-opp 0 set meetings-opp 0 set meetings-known-sol 0 set meetings-sol 0 set meetings-known-pro 0 set meetings-pro 0 ;; Initializes the counters of oversights and resolutions at high and low hierarchical levels. ifelse (opportunities-exit? and (decision-structure != "anarchy" or availability-structure != "anarchy" or access-structure != "anarchy")) [ set countOveHigh 0 set countOveLow 0 set countResHigh 0 set countResLow 0 ] [ set countOveHigh "N/A" set countOveLow "N/A" set countResHigh "N/A" set countResLow "N/A" ] ;; Initializes the counter of how long a decision process stays blocked. ask patches [set pcolor-white-since 0] ;; Creates the agents that are initially present in the organization. set-default-shape participant "participant" create-participant initial-participants ;; creates the participants and initializes their variables [ setxy random world-width random world-height set blocked? false set charged? false set with-problem nobody set participant_id who set encountered [] ] set-default-shape opportunity "opportunity" create-opportunity initial-opportunities ;; creates the choice opportunities and initializes their variables [ setxy random world-width random world-height set blocked? false set charged? false set with-problem nobody set opportunity_id (who - initial-participants) ] set-default-shape solution "solution" create-solution initial-solutions ;; creates the solutions and initializes their variables [ setxy random world-width random world-height set blocked? false set solution_id (who - initial-participants - initial-opportunities) ] set-default-shape problem "problem" create-problem initial-problems ;; creates the problems and initializes their variables [ setxy random world-width random world-height set blocked? false set postponed? false set to-opportunity nobody set passed? false set to-participant nobody set since 0 set problem_id (who - initial-participants - initial-opportunities - initial-solutions) ] ;; Participants and problems are endowed with energy, solutions are endowed with efficiency assign-ability assign-difficulty assign-efficiency end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; What is done when the "Go Step" button is pressed and what is repeated at each step when the "Go Until" button is pressed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to go ;;;;;;;;;;;;;;;;;;;;;; MISCELLANEOUS ;; The number of ticks is updated. Eventually, the simulation is stopped. tick if ((stop-at > 0) and (ticks = stop-at)) [ if (show-details?) [write-survivors] stop ] ;; Eventually, labels are depicted near the agents. Labels show participants' ability, solutions' efficiency and problems' difficulty, respectively. if (show-details?) [show-labels] ;;; THE SIMULATION IS NOT ALLOWED TO BEGIN IF MINIMUM VALUES OF ABILITY, EFFICIENCY AND DIFFICULTY ARE GREATER THAN THE CORRESPONDING MAXIMUM VALUES if (min-ability > max-ability) [ type "MINIMUM ABILITY SHOULD NOT BE GREATER THAN MAXIMUM ABILITY" stop ] if (min-efficiency > max-efficiency) [ type "MINIMUM EFFICIENCY SHOULD NOT BE GREATER THAN MAXIMUM EFFICIENCY" stop ] if (min-difficulty > max-difficulty) [ type "MINIMUM DIFFICULTY SHOULD NOT BE GREATER THAN MAXIMUM DIFFICULTY" stop ] ;;;;;;;;;;;;;;; ABILITY, EFFICIENCY AND DIFFICULTY MAY NEED TO BE ASSIGNED AGAIN ;; If ability, efficiency and difficulty are distributed according to the numbering of agents (competence or incompetence) ;; and if some participants, problems or solutions exit, then ability, efficiency and difficulty must be re-distributed to all of them. ;; Note that this may impact on the number of flights, since blocked agents may be assigned new values of ability, efficiency or difficulty. if ((dist-ability = "competence" or dist-ability = "incompetence") and participants-exit?) [ assign-ability ] if ((dist-efficiency = "competence" or dist-efficiency = "incompetence") and solutions-exit?) [ assign-efficiency ] if ((dist-difficulty = "competence" or dist-difficulty = "incompetence") and problems-exit?) [ assign-difficulty ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DECISION - MAKING ;; Though decisions are made by participants, it is more convenient to let patches operate. ask patches [ ;; Resets the world on black, except flying couples. ifelse (any? problem-here with [postponed? or passed?]) [set pcolor brown] [ if (pcolor != white) [set pcolor black] ] ;; If there is at least one participant, one choice opportunity and one solution, then a decision is made. if (any? participant-here and any? opportunity-here and any? solution-here) [ ;; Agents paired because of a flight enter the decision process on equal status with the others. ask participant-here [ if (charged?) [ set charged? false set with-problem nobody ] ] ask opportunity-here [ if (charged?) [ set charged? false set with-problem nobody ] ] ask problem-here [ if (postponed?) [ set postponed? false set to-opportunity nobody ] if (passed?) [ set passed? false set to-participant nobody ] ] ;; If there are problems as well, either they are resolved if their ability is sufficient or all agents stay put until another opportunity or another participant passes by and takes a problem away. ifelse (any? problem-here) [ ;; If the sum of the ability of all participants on a patch, multiplied by the efficiency of the most efficient solution on the ;; same patch, is greater or equal than the sum of the difficulty of all problems on the same patch, then decisions are made by resolution. ifelse ((sum [ability] of participant-here)*([efficiency] of max-one-of solution-here [efficiency]) >= (sum [difficulty] of problem-here)) [ set num-resolution num-resolution + 1 ;; A decision by resolution is marked by a green square. The counters of the life of blocked decisions and flying pairs are reset. if (pcolor = white) [set num-blocked-resolution num-blocked-resolution + 1] set pcolor lime set pcolor-white-since 0 ask problem-here [set since 0] ;; Write information on the control center. if (show-details?) [write-resolutions] ;; The indicators of the percentages of resolutions on low and high hierarchical levels. let chosenOppRes one-of opportunity-here if (opportunities-exit? and (decision-structure != "anarchy" or availability-structure != "anarchy" or access-structure != "anarchy")) [ ifelse ([opportunity_id] of chosenOppRes < (count opportunity) * 0.5) [set countResHigh countResHigh + 1] [set countResLow countResLow + 1] ] ;; If participants exit after a decision is made, all participants on the patch are killed. if (participants-exit?) [ kill participant-here ] ;; If opportunities exit after a decision is made, one of the opportunities that are on the patch is picked up and killed. if (opportunities-exit?) [ kill chosenOppRes ] ;; If solutions exit after a decision is made, the most efficient solution on the patch is killed. if (solutions-exit?) [ kill max-one-of solution-here [efficiency] ] ;; If problems exit after a decision is made, all problems on the patch are killed. if (problems-exit?) [ kill problem-here ] ;; If there are still agents on the patch, they must be free to move. This is not obvious, because they may stem from a flight. ask turtles-here [ if (blocked?) [set blocked? false] ] ] ;; If the ability of the participants is not sufficient to make a decision, all agents on the patch are blocked. ;; Eventually, a flight might enable the remaining agents to make a decision either by resolution or by oversight. [ ask turtles-here [set blocked? true] ;; A blocked decision process is marked by a white square. if (pcolor != white) [ set pcolor white set pcolor-white-since ticks ] ;; Eventually, a flight by postponement takes place. ifelse (postpone? and count opportunity-here > 1) [ ;; An opportunity and a problem are chosen to be paired to one another. let which-opportunity max-one-of opportunity-here [opportunity_id] let which-problem-for-opportunity max-one-of problem-here [difficulty] ;; Checks that there is at least one place to which the chosen opportunity can move. if ( (decision-structure = "anarchy" and access-structure = "anarchy" and availability-structure = "anarchy") or (decision-structure = "anarchy" and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at 1 0) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 1) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at -1 0) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 -1) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity]) and availability-structure = "anarchy") or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at 1 0) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 1) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at -1 0) with [solution_id > [opportunity_id] of which-opportunity])) or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 -1) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at 1 0) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 1) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at -1 0) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 -1) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at 1 0) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 1) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at -1 0) with [solution_id > [opportunity_id] of which-opportunity])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = "hierarchy" and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity]) and (availability-structure = "hierarchy" and not any? (solution-on patch-at 0 -1) with [solution_id > [opportunity_id] of which-opportunity])) ) [ ;; If yes, a flight by postponement takes place. set num-postponement num-postponement + 1 ;; A flight takes place by postponing the most difficult problem to the least important opportunity. ask which-opportunity [ set blocked? false set charged? true set with-problem which-problem-for-opportunity ] ask which-problem-for-opportunity [ set blocked? false set postponed? true set to-opportunity which-opportunity set since ticks ] ;; Write information on the control center. if (show-details?) [write-postponements] ] ] ;; After the possibility of a flight by postponement, the possibility of a flight by buck-passing is considered. [ ;; Eventually, a flight by buck-passing takes place. if (buckpass? and count participant-here > 1) [ ;; A participant and a problem are chosen to be paired to one another. let which-participant min-one-of participant-here [ability] let which-problem-for-participant max-one-of problem-here [difficulty] ;; Checks that there is at least one place to which the chosen participant can move. if (decision-structure = "anarchy" or (decision-structure = "hierarchy" and (not any? (opportunity-on patch-at 1 0) with [opportunity_id < [participant_id] of which-participant] or not any? (opportunity-on patch-at 0 1) with [opportunity_id < [participant_id] of which-participant] or not any? (opportunity-on patch-at -1 0) with [opportunity_id < [participant_id] of which-participant] or not any? (opportunity-on patch-at 0 -1) with [opportunity_id < [participant_id] of which-participant])) ) [ set num-buck-passing num-buck-passing + 1 ;; A flight takes place by buck-passing the most difficult problem to the least able participant. ask which-participant [ set blocked? false set charged? true set with-problem which-problem-for-participant ] ask which-problem-for-participant [ set blocked? false set passed? true set to-participant which-participant set since ticks ] ;; Write information on the control center. if (show-details?) [write-buck-passings] ] ] ] ] ] ;; On the contrary, if there are no problems to be solved, decisions are made by oversight. Since decision-making by oversight ;; has no energy requirements, there is no reason to use more than one choice opportunity. Thus, if there are several participants, ;; several solutions and several opportunities on the same patch, all participants and all solutions make a decision exploiting ;; only one opportunity and making use of only one solution. If these agents exit after making a decision, all participants on the ;; patch exit, but only one randomly chosen solution exits and only one randomly chosen opportunity exits. [ set num-oversight num-oversight + 1 ;; A decision by oversight is marked by a sky-blue square. The counter of the life of blocked decisions is reset. if (pcolor = white) [set num-blocked-oversight num-blocked-oversight + 1] set pcolor sky set pcolor-white-since 0 ;; Write information on the control center if (show-details?) [write-oversights] ;; The indicators of the percentages of oversights on low and high hierarchical levels. let chosenOppOve one-of opportunity-here if (opportunities-exit? and (decision-structure != "anarchy" or availability-structure != "anarchy" or access-structure != "anarchy")) [ ifelse ([opportunity_id] of chosenOppOve < (count opportunity) * 0.5) [set countOveHigh countOveHigh + 1] [set countOveLow countOveLow + 1] ] ;; If participants exit after a decision is made, all participants on the patch are killed. if (participants-exit?) [ kill participant-here ] ;; If opportunities exit after a decision is made, one of the opportunities that are on the patch is picked up and killed. if (opportunities-exit?) [ kill chosenOppOve ] ;; If solutions exit after a decision is made, one of the solutions that are on the patch is picked up and killed. if (solutions-exit?) [ kill one-of solution-here ] ;; If there are still agents on the patch, they must be free to move. This is not obvious, because they may stem from a flight. ask turtles-here [ if (blocked?) [set blocked? false] ] ] ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;; AND FINALLY MOVE ;; Agents are only allowed to turn by multiples of 90 degrees. ;; The movement of participants may be constrained by the decision structure. ;; The movement of solutions may be constrained by the availability structure. ;; The movement of problems may be constrained by the access structure. ;; The movement of opportunities may me constrained by the decision structure, the availability structure and the access structure. ;; Flying couples move first. Their movements take account of the positions of other agents. ask patches [ ;; Paired problems and opportunities move together. ;; Opportunities must consider where they are allowed to move. Problems just follow opportunities. ask opportunity-here with [not blocked? and charged?] [ set heading ((random 4) * 90) let initialheading heading let stop? false while [stop? = false] [ if ( (decision-structure = "anarchy" and access-structure = "anarchy" and availability-structure = "anarchy") or (decision-structure = "anarchy" and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and availability-structure = "anarchy") or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and access-structure = "anarchy" and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) ) [ if (pcolor = brown) [set pcolor black] move-to patch-ahead 1 set pcolor brown set stop? true ] set heading ((heading + 90) mod 360) if (heading = initialheading) [set stop? true] ] ] ask problem-here with [not blocked? and postponed? and to-opportunity != nobody] [ move-to to-opportunity ] ;; Paired problems and participants move together. ;; Participants must consider where they are allowed to move. Problems just follow participants. ask participant-here with [not blocked? and charged?] [ set heading ((random 4) * 90) let initialheading heading let stop? false while [stop? = false] [ if ( (decision-structure = "anarchy") or ((decision-structure = "hierarchy") and (not any? (opportunity-on patch-ahead 1) with [opportunity_id < [participant_id] of myself])) ) [ if (pcolor = brown) [set pcolor black] move-to patch-ahead 1 set pcolor brown set stop? true ] set heading ((heading + 90) mod 360) if (heading = initialheading) [set stop? true] ] ] ask problem-here with [not blocked? and passed? and to-participant != nobody] [ move-to to-participant ] ] ;; Uncoordinated agents move in different, randomly chosen directions. ;; However, participants must take account of the decision structure, solutions take account of the availability structure and problems ;; take account of the access structure. ;; Finally, opportunities must take account of both the decision structure, the availability structure and the access structure. ;; The highest-ranked agents are those with lowest ID. ask participant with [not blocked? and not charged?] [ set heading ((random 4) * 90) if ((decision-structure = "anarchy") or ((decision-structure = "hierarchy") and (not any? (opportunity-on patch-ahead 1) with [opportunity_id < [participant_id] of myself]))) [ move-to patch-ahead 1 ] ] ask opportunity with [not blocked? and not charged?] [ set heading ((random 4) * 90) if ( (decision-structure = "anarchy" and access-structure = "anarchy" and availability-structure = "anarchy") or (decision-structure = "anarchy" and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and availability-structure = "anarchy") or (decision-structure = "anarchy" and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and access-structure = "anarchy" and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and access-structure = "anarchy" and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and availability-structure = "anarchy") or ((decision-structure = "hierarchy" and not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = "hierarchy" and not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself]) and (availability-structure = "hierarchy" and not any? (solution-on patch-ahead 1) with [solution_id > [opportunity_id] of myself])) ) [ move-to patch-ahead 1 ] ] ask solution with [not blocked?] [ set heading ((random 4) * 90) if ((availability-structure = "anarchy") or ((availability-structure = "hierarchy") and (not any? (opportunity-on patch-ahead 1) with [opportunity_id < [solution_id] of myself]))) [ move-to patch-ahead 1 ] ] ask problem with [not blocked? and not postponed? and not passed?] [ set heading ((random 4) * 90) if ((access-structure = "anarchy") or ((access-structure = "hierarchy") and (not any? (opportunity-on patch-ahead 1) with [opportunity_id < [problem_id] of myself]))) [ move-to patch-ahead 1 ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,;;;;;; THE NUMBER OF AGENTS AVAILABLE FOR DECISION-MAKING set free-participants free-participants + count participant with [not blocked? and not charged?] set ave-free-participants free-participants / ticks set free-opportunities free-opportunities + count opportunity with [not blocked?] set ave-free-opportunities free-opportunities / ticks set free-solutions free-solutions + count solution with [not blocked?] set ave-free-solutions free-solutions / ticks set free-problems free-problems + count problem with [not blocked?] set ave-free-problems free-problems / ticks ;;;;;;;;;;;; MEASURES WHETHER OPPORTUNITIES, SOLUTIONS AND PROBLEMS ARE MET, THAT HAD ALREADY BEEN MET ;; Participants who are in blocked decision processes, as well as participants charged with problems, are excluded. ask participant with [not blocked? and not charged?] [ set meetings-known-opp meetings-known-opp + count opportunity-here with [member? who [encountered] of myself] set meetings-opp meetings-opp + count opportunity-here set meetings-known-sol meetings-known-sol + count solution-here with [member? who [encountered] of myself] set meetings-sol meetings-sol + count solution-here set meetings-known-pro meetings-known-pro + count problem-here with [member? who [encountered] of myself] set meetings-pro meetings-pro + count problem-here ;; Agents that had not been previously met, are added to the list. if (any? turtles-here with [breed != participant and not (member? who [encountered] of myself)]) [ foreach [who] of turtles-here with [breed != participant and not (member? who [encountered] of myself)] [ set encountered fput ? encountered ] ] ] ;;;;;;;;;; COUNTS THE NUMBER OF BLOCKED DECISIONS, THE NUMBER OF POSTPONED PROBLEMS AND THE NUMBER OF PASSED PROBLEMS if (any? patches with [pcolor = white]) [ ;; Number of blocked decision processes. set num-blocked num-blocked + count patches with [pcolor = white] set ave-num-blocked num-blocked / ticks ;; Size of blocked decision processes. set size-blocked size-blocked + count turtles with [blocked?] / count patches with [pcolor = white] set ave-size-blocked size-blocked / ticks ;; Life of blocked decision processes. let life-blocked-now 0 ask patches with [pcolor = white] [ set life-blocked-now life-blocked-now + (ticks - pcolor-white-since) ] set life-blocked-now life-blocked-now / count patches with [pcolor = white] set life-blocked life-blocked + life-blocked-now set ave-life-blocked life-blocked / ticks ] if (any? problem with [postponed?]) [ ;; Number of postponed problems. set num-postponed num-postponed + count opportunity with [charged?] set ave-num-postponed num-postponed / ticks ;; Life of postponed problems let life-postponed-now 0 ask problem with [postponed?] [ set life-postponed-now life-postponed-now + (ticks - since) ] set life-postponed-now life-postponed-now / count problem with [postponed?] set life-postponed life-postponed + life-postponed-now set ave-life-postponed life-postponed / ticks ] if (any? problem with [passed?]) [ ;; Number of passed problems. set num-passed num-passed + count participant with [charged?] set ave-num-passed num-passed / ticks ;; Life of passed problems. let life-passed-now 0 ask problem with [passed?] [ set life-passed-now life-passed-now + (ticks - since) ] set life-passed-now life-passed-now / count problem with [passed?] set life-passed life-passed + life-passed-now set ave-life-passed life-passed / ticks ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;; Procedures to distribute ability to participants, efficiency to solutions, and difficulty to problems ;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to assign-ability if (dist-ability = "random") [ ask participant [set ability random-float (max-ability - min-ability) + min-ability] ] if (dist-ability = "competence") [ ifelse (count participant > 1) [ ask participant [set ability min-ability + ((count participant - 1 - participant_id) / (count participant - 1)) * (max-ability - min-ability)] ] [ ask participant [set ability (min-ability + max-ability) / 2] ] ] if (dist-ability = "incompetence") [ ifelse (count participant > 1) [ ask participant [set ability min-ability + (participant_id / (count participant - 1)) * (max-ability - min-ability)] ] [ ask participant [set ability (min-ability + max-ability) / 2] ] ] end to assign-efficiency if (dist-efficiency = "random") [ ask solution [set efficiency random-float (max-efficiency - min-efficiency) + min-efficiency] ] if (dist-efficiency = "competence") [ ifelse (count solution > 1) [ ask solution [set efficiency min-efficiency + ((count solution - 1 - solution_id) / (count solution - 1)) * (max-efficiency - min-efficiency)] ] [ ask solution [set efficiency (min-efficiency + max-efficiency) / 2] ] ] if (dist-efficiency = "incompetence") [ ifelse (count solution > 1) [ ask solution [set efficiency min-efficiency + (solution_id / (count solution - 1)) * (max-efficiency - min-efficiency)] ] [ ask solution [set efficiency (min-efficiency + max-efficiency) / 2] ] ] end to assign-difficulty if (dist-difficulty = "random") [ ask problem [set difficulty random-float (max-difficulty - min-difficulty) + min-difficulty] ] if (dist-difficulty = "competence") [ ifelse (count problem > 1) [ ask problem [set difficulty min-difficulty + ((count problem - 1 - problem_id) / (count problem - 1)) * (max-difficulty - min-difficulty)] ] [ ask problem [set difficulty (min-difficulty + max-difficulty) / 2] ] ] if (dist-difficulty = "incompetence") [ ifelse (count problem > 1) [ ask problem [set difficulty min-difficulty + (problem_id / (count problem - 1)) * (max-difficulty - min-difficulty)] ] [ ask problem [set difficulty (max-difficulty - min-difficulty) / 2] ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; If participants, choice opportunities, solutions or problems exit after a decision is made, these procedures are acvtivated ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to kill [morituri] if (morituri != nobody) [ ask morituri [ if (breed = participant) [ ;; If it is a participant charged with a problem, free the problem. if (charged?) [ let this-problem-to-participant with-problem if (any? problem with [who = this-problem-to-participant]) [ ask this-problem-to-participant [ set passed? false set to-participant nobody ] ] ] ;; If the participant to be killed must be replaced, a new one is created. if (replace-participants?) [ ;; Move the participant to be replaced. let found? false let localcounter 0 while [not found?] [ let newxcor random world-width let newycor random world-height if (not any? turtles-on patch newxcor newycor) [ set found? true set xcor newxcor set ycor newycor ] set localcounter localcounter + 1 if (localcounter > 10000) [ type "TOO HIGH AGENT DENSITY" stop ] ] ;; Clone it, but with the following differences. hatch 1 [ set blocked? false set charged? false set with-problem nobody set encountered [] ] ] ;; The participants who met it, forget it. ask other participant [ foreach encountered [ if (? = [who] of myself) [set encountered remove ? encountered] ] ] ;; Finally kills it. die ] if (breed = opportunity) [ if (charged?) [ let this-problem with-problem if (any? problem with [who = this-problem]) [ ask this-problem [ set postponed? false set to-opportunity nobody ] ] ] ;; If the opportunity to be killed must be replaced, a new one is created. if (replace-opportunities?) [ ;; Move the opportunity to be replaced. let found? false let localcounter 0 while [not found?] [ let newxcor random world-width let newycor random world-height if (not any? turtles-on patch newxcor newycor) [ set found? true set xcor newxcor set ycor newycor ] set localcounter localcounter + 1 if (localcounter > 10000) [ type "TOO HIGH AGENT DENSITY" stop ] ] ;; Clone it, but with the following differences. hatch 1 [ set blocked? false set charged? false set with-problem nobody ] ] ;; The participants who met it, forget it. ask participant [ foreach encountered [ if (? = [who] of myself) [set encountered remove ? encountered] ] ] ;; Finally kills it. die ] if (breed = solution) [ ;; If the solution to be killed must be replaced, a new one is created. if (replace-solutions?) [ ;; Move the solution to be replaced. let found? false let localcounter 0 while [not found?] [ let newxcor random world-width let newycor random world-height if (not any? turtles-on patch newxcor newycor) [ set found? true set xcor newxcor set ycor newycor ] set localcounter localcounter + 1 if (localcounter > 10000) [ type "TOO HIGH AGENT DENSITY" stop ] ] ;; Clone it, but with the following differences. hatch 1 [ set blocked? false ] ] ;; The participants who met it, forget it. ask participant [ foreach encountered [ if (? = [who] of myself) [set encountered remove ? encountered] ] ] ;; Finally kills it. die ] if (breed = problem) [ ;; If it is a postponed problem, free the opportunity to which it is postponed. if (postponed?) [ let this-opportunity to-opportunity if (any? opportunity with [who = this-opportunity]) [ ask this-opportunity [ set charged? false set with-problem nobody ] ] ] ;; If is it a problem passed to somebody else, free this participant. if (passed?) [ let this-participant to-participant if (any? participant with [who = this-participant]) [ ask this-participant [ set charged? false set with-problem nobody ] ] ] ;; If the problem to be killed must be replaced, a new one is created. if (replace-problems?) [ ;; Move the problem to be replaced. let found? false let localcounter 0 while [not found?] [ let newxcor random world-width let newycor random world-height if (not any? turtles-on patch newxcor newycor) [ set found? true set xcor newxcor set ycor newycor ] set localcounter localcounter + 1 if (localcounter > 10000) [ type "TOO HIGH AGENT DENSITY" stop ] ] ;; Clone it, but with the following differences. hatch 1 [ set blocked? false set postponed? false set to-opportunity nobody set passed? false set to-participant nobody set since 0 ] ] ;; The participants who met it, forget it. ask participant [ foreach encountered [ if (? = [who] of myself) [set encountered remove ? encountered] ] ] ;; Finally kills it. die ] ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;; Writes labels on the screen and information on decision-making on the command center ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to show-labels ask participant [ set label round ability ] ask problem [ set label round difficulty ] ask solution [ set label precision efficiency 1 ] end to write-oversights type "OVERSIGHT N." write num-oversight actors-involved end to write-resolutions type "RESOLUTION N." write num-resolution actors-involved end to write-postponements type "FLIGHT BY POSTPONEMENT N." write num-postponement actors-involved end to write-buck-passings type "FLIGHT BY BUCK-PASSING N." write num-buck-passing actors-involved end to actors-involved ask participant-here [ type " Identity:" write who type ". One of:" write count participant type " participants. Ability:" write ability type ". Charged?" write charged? type ". With problem:" write with-problem type "." ] ask opportunity-here [ type " Identity:" write who type ". One of:" write count opportunity type " opportunities." type " Charged?" write charged? type ". With problem:" write with-problem type "." ] ask solution-here [ type " Identity:" write who type ". One of:" write count solution type " solutions. Efficiency:" write efficiency type "." ] ask problem-here [ type " Identity:" write who type ". One of:" write count problem type " problems. Difficulty:" write difficulty type ". Postponed?" write postponed? type ". To opportunity:" write to-opportunity type ". Passed?" write passed? type ". To participant:" write to-participant type "." ] print " " end to write-survivors print "" type "SURVIVING PARTICIPANTS" print "" ifelse (any? participant) [ type "Identities:" ask participant [ write participant_id ] print " " ] [ type "none" ] type "SURVIVING OPPORTUNITIES" print "" ifelse (any? opportunity) [ type "Identities:" ask opportunity [ write opportunity_id ] print " " ] [ type "none" ] type "SURVIVING SOLUTIONS" print "" ifelse (any? solution) [ type "Identities:" ask solution [ write solution_id ] print " " ] [ type "none" ] type "SURVIVING PROBLEMS" print "" ifelse (any? problem) [ type "Identities:" ask problem [ write problem_id ] print " " ] [ type "none" ] print "" end
There is only one version of this model, created over 11 years ago by Guido Fioretti.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
The Garbage Can Model of Organizational Choice.png | preview | Preview for 'The Garbage Can Model of Organizational Choice' | over 11 years ago, by Guido Fioretti | Download |
This model does not have any ancestors.
This model does not have any descendants.
John Dong
How does it work?
Hi Guido, thanks very much for sharing this great model. I tried to run it in NetLogo 6.2 but it doesn't work. Could you kindly let me know how I can solve the problem? Thanks a lot!
Posted almost 4 years ago
Guido Fioretti
A more recent version (Question)
Dear John, thank you for your interest in this model of mine. Its most recent version is in NetLogo 6.1. You find it here: https://www.comses.net/codebases/f0613922-9cb1-4656-a26c-af57f823fb69/releases/3.1.1/ Please contact me for further details: guido.fioretti AATT unibo.it
Posted almost 4 years ago