;; THE GARBAGE CAN MODEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Variables declaration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; globals [ ;; population dynamics 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 ;; kinds of decision-making t_decision ;; total number of decisions n_resolution ;; number of decisions by resolution in a tick t_resolution ;; total number of decisions by resolution n_oversight ;; number of decisions by oversight in a tick t_oversight ;; total number of decisions by oversight n_flight ;; number of flights in a tick t_flight ;; total number of flights n_flight_res ;; number of flights in a tick, that are followed by decisions by resolution t_flight_res ;; total number of flights that are followed by decisions by resolution n_flight_ove ;; number of flights in a tick, that are followed by decisions by oversight t_flight_ove ;; total number of flights that are followed by decisions by oversight t_energy_par ;; total energy of participants t_energy_pro ;; total energy required by problems ;; some auxiliary variables decimal_par ;; the decimal fraction of participants who enter or exit decimal_opp ;; the decimal fraction of opportunities who enter or exit decimal_sol ;; the decimal fraction of solutions who enter or exit decimal_pro ;; the decimal fraction of problems who enter or exit cumulative_problems ;; the sum of problems over time, used to compute "problem latency" chosenOppOve ;; the opportunity selected to make a decision by oversight, necessary to compute "countOve*" chosenOppRes ;; the opportunity selected to make a decision by resolution, necessary to compute "countRes*" ;; the indicators suggested by Cohen, March and Olsen problem_jumps problem_bindings problem_latency unsolved_problems participant_jumps participant_bindings used_energy excess_energy unexploited_opportunities waiting_time ;; other indicators needed in order to test all of CMO's hypotheses with hierarchical structures countOveI ;; the number of oversights making use of opportunities in the the first class of importance percentOveI ;; the above as percentage of the number of decisions countOveII ;; the number of oversights making use of opportunities in the second class of importance percentOveII ;; the above as percentage of the number of decisions countOveIII ;; the number of oversights making use of opportunities in the third class of importance percentOveIII ;; the above as percentage of the number of decisions countOveIV ;; the number of oversights making use of opportunities in the fourth class of importance percentOveIV ;; the above as percentage of the number of decisions countResI ;; the number of resolutions making use of opportunities in the first class of importance percentResI ;; the above as percentage of the number of decisions countResII ;; the number of resolutions making use of opportunities in the second class of importance percentResII ;; the above as percentage of the number of decisions countResIII ;; the number of resolutions making use of opportunities in the third class of importance percentResIII ;; the above as percentage of the number of decisions countResIV ;; the number of resolutions making use of opportunities in the fourth class of importance percentResIV ;; the above as percentage of the number of decisions ] turtles-own [ blocked? ;; whether an agent is allowed to move date_of_birth ;; the tick when an agent was born id_at_birth ;; its identity when it was born ] breed [solution] breed [opportunity] breed [problem] breed [participant] participant-own [ participant_id ;; the identification number of participants energy_par ;; the energy of participants ] 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 coefficient by which solutions multiply the energy of participants ] problem-own [ problem_id ;; the identification number of problems energy_pro ;; the energy of problems postponed? ;; eventually, this problem is postponed to-opportunity ;; to this opportunity ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;; What is done when the "Setup" button is pressed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup ca ;; 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 set decimal_par 0 set decimal_opp 0 set decimal_sol 0 set decimal_pro 0 ;; creates the agents that are initially present in the organization set-default-shape participant "participant" create-participant initial-number-of-participants ;; creates the participants and initializes their variables [ setxy random-pxcor random-pycor set blocked? false set date_of_birth ticks set id_at_birth who set participant_id id_at_birth ] set-default-shape opportunity "opportunity" create-opportunity initial-number-of-opportunities ;; creates the choice opportunities and initializes their variables [ setxy random-pxcor random-pycor set blocked? false set charged? false set with-problem nobody set date_of_birth ticks set id_at_birth (who - initial-number-of-participants) set opportunity_id id_at_birth ] set-default-shape solution "solution" create-solution initial-number-of-solutions ;; creates the solutions and initializes their variables [ setxy random-pxcor random-pycor set blocked? false set date_of_birth ticks set id_at_birth (who - initial-number-of-participants - initial-number-of-opportunities) set solution_id id_at_birth ] set-default-shape problem "problem" create-problem initial-number-of-problems ;; creates the problems and initializes their variables [ setxy random-pxcor random-pycor set blocked? false set postponed? false set to-opportunity nobody set date_of_birth ticks set id_at_birth (who - initial-number-of-participants - initial-number-of-opportunities - initial-number-of-solutions) set problem_id id_at_birth ] ;; Participants and problems are endowed with energy, solutions are endowed with efficiency. assign-energy-par assign-efficiency assign-energy-pro ;; Initializes the number of decision-makings. set t_decision 0 set n_resolution 0 set t_resolution 0 set n_oversight 0 set t_oversight 0 set n_flight 0 set t_flight 0 set n_flight_res 0 set t_flight_res 0 set n_flight_ove 0 set t_flight_ove 0 ;; Initializes the indicators and their auxiliary variables. ifelse (problems-exit?) [set unsolved_problems count problem] [set unsolved_problems "not available"] set problem_jumps t_flight set problem_bindings 0 set cumulative_problems 0 set problem_latency 0 set participant_bindings 0 ifelse (not participants-exit?) [set participant_jumps 0] [set participant_jumps "not available"] set used_energy 0 set excess_energy 0 ifelse (opportunities-exit?) [set unexploited_opportunities count opportunity] [set unexploited_opportunities "not available"] ifelse (opportunities-exit?) [set waiting_time 0] [set waiting_time "not available"] if ((opportunities-exit?) and ((decision-structure != 0) or (access-structure != 0))) [ set countOveI 0 set countOveII 0 set countOveIII 0 set countOveIV 0 set countResI 0 set countResII 0 set countResIII 0 set countResIV 0 ] set percentOveI "not available" set percentOveII "not available" set percentOveIII "not available" set percentOveIV "not available" set percentResI "not available" set percentResII "not available" set percentResIII "not available" set percentResIV "not available" 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 ;;; THE SIMULATION IS NOT ALLOWED TO BEGIN IF MINIMUM VALUES OF ENERGY AND EFFICIENCY ARE GREATER THAN THE CORRESPONDING MAXIMUM VALUES if (min-energy-par > max-energy-par) [ type "MINIMUM PARTICIPANT ENERGY SHOULD NOT BE GREATER THAN MAXIMUM PARTICIPANT ENERGY" stop ] if (min-efficiency > max-efficiency) [ type "MINIMUM EFFICIENCY SHOULD NOT BE GREATER THAN MAXIMUM EFFICIENCY" stop ] if (min-energy-pro > max-energy-pro) [ type "MINIMUM PROBLEM ENERGY SHOULD NOT BE GREATER THAN MAXIMUM PROBLEM ENERGY" stop ] ;;;;;;;;;;;;;;;;;;;;;;; AGENTS FLOW IN AND OUT OF THE MODEL ;; Net flows of participants. ifelse (ticks != 0 and (remainder ticks 10) = 0) [set decimal_par (10 * abs net-flow-of-participants - 10 * abs int net-flow-of-participants)] [set decimal_par 0] if (((stop-flow-par-at = 0) or (ticks < stop-flow-par-at)) and (net-flow-of-participants > 0)) [ repeat (int net-flow-of-participants + decimal_par) [ create-participant 1 [ setxy random-pxcor random-pycor set blocked? false set date_of_birth ticks set id_at_birth (initial-number-of-participants + arrivals-departures_par) set participant_id id_at_birth set energy_par random-float (max-energy-par - min-energy-par) + min-energy-par ] set arrivals-departures_par arrivals-departures_par + 1 ] ] if (((stop-flow-par-at = 0) or (ticks < stop-flow-par-at)) and (net-flow-of-participants < 0) and (count participant > 0)) [ repeat (- int net-flow-of-participants + decimal_par) [ kill participant with [participant_id = (count participant - 1)] set arrivals-departures_par arrivals-departures_par - 1 ] ] ;; Net flows of opportunities. ifelse (ticks != 0 and (remainder ticks 10) = 0) [set decimal_opp (10 * abs net-flow-of-opportunities - 10 * abs int net-flow-of-opportunities)] [set decimal_opp 0] if (((stop-flow-opp-at = 0) or (ticks < stop-flow-opp-at)) and (net-flow-of-opportunities > 0)) [ repeat (int net-flow-of-opportunities + decimal_opp) [ create-opportunity 1 [ setxy random-pxcor random-pycor set blocked? false set charged? false set with-problem nobody set date_of_birth ticks set id_at_birth (initial-number-of-opportunities + arrivals-departures_opp) set opportunity_id id_at_birth ] set arrivals-departures_opp arrivals-departures_opp + 1 ] ] if (((stop-flow-opp-at = 0) or (ticks < stop-flow-opp-at)) and (net-flow-of-opportunities < 0) and (count opportunity > 0)) [ repeat (- int net-flow-of-opportunities + decimal_opp) [ kill opportunity with [opportunity_id = (count opportunity - 1)] set arrivals-departures_opp arrivals-departures_opp - 1 ] ] ;; Net flows of solutions. ifelse (ticks != 0 and (remainder ticks 10) = 0) [set decimal_sol (10 * abs net-flow-of-solutions - 10 * abs int net-flow-of-solutions)] [set decimal_sol 0] if (((stop-flow-sol-at = 0) or (ticks < stop-flow-sol-at)) and (net-flow-of-solutions > 0)) [ repeat (int net-flow-of-solutions + decimal_sol) [ create-solution 1 [ setxy random-pxcor random-pycor set blocked? false set date_of_birth ticks set id_at_birth (initial-number-of-solutions + arrivals-departures_sol) set solution_id id_at_birth set efficiency random-float (max-efficiency - min-efficiency) + min-efficiency ] set arrivals-departures_sol arrivals-departures_sol + 1 ] ] if (((stop-flow-sol-at = 0) or (ticks < stop-flow-sol-at)) and (net-flow-of-solutions < 0) and (count solution > 0)) [ repeat (- int net-flow-of-solutions + decimal_sol) [ kill solution with [solution_id = (count solution - 1)] set arrivals-departures_sol arrivals-departures_sol - 1 ] ] ;; Net flows of problems. ifelse (ticks != 0 and (remainder ticks 10) = 0) [set decimal_pro (10 * abs net-flow-of-problems - 10 * abs int net-flow-of-problems)] [set decimal_pro 0] if (((stop-flow-pro-at = 0) or (ticks < stop-flow-pro-at)) and (net-flow-of-problems > 0)) [ repeat (int net-flow-of-problems + decimal_pro) [ create-problem 1 [ setxy random-pxcor random-pycor set blocked? false set postponed? false set to-opportunity nobody set date_of_birth ticks set id_at_birth (initial-number-of-problems + arrivals-departures_pro) set problem_id id_at_birth set energy_pro random-float (max-energy-pro - min-energy-pro) + min-energy-pro ] set arrivals-departures_pro arrivals-departures_pro + 1 ] ] if (((stop-flow-pro-at = 0) or (ticks < stop-flow-pro-at)) and (net-flow-of-problems < 0) and (count problem > 0)) [ repeat (- int net-flow-of-problems + decimal_pro) [ kill problem with [problem_id = (count problem - 1)] set arrivals-departures_pro arrivals-departures_pro - 1 ] ] ;;;;;;;;;;;;;;; ENERGY AND EFFICIENCY MAY NEED TO BE ASSIGNED AGAIN ;; If energy and efficiency are distributed according to the numbering of agents (dist-energy-par = {0,2}, ;; dist-energy-pro = {0,2}, dist-efficiency-sol = {0,2}) and if some participants, problems or solutions are born or ;; die during the simulation, then energy and efficiency 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 energy or efficiency. ;; Participants, problems and solutions that are born during the simulation are endowed with random values of energy, ;; so if dist-energy-par = 1, dist-energy-pro = 1 or dist-efficiency-sol = 1 nothing has to be changed. if (((dist-energy-par = 0) or (dist-energy-par = 2)) and (((net-flow-of-participants != 0) and ((ticks <= stop-flow-par-at) or (stop-flow-par-at = 0))) or (participants-exit?))) [ assign-energy-par ] if (((dist-energy-pro = 0) or (dist-energy-pro = 2)) and (((net-flow-of-problems != 0) and ((ticks <= stop-flow-pro-at) or (stop-flow-pro-at = 0))) or (problems-exit?))) [ assign-energy-pro ] if (((dist-efficiency = 0) or (dist-efficiency = 2)) and (((net-flow-of-solutions != 0) and ((ticks <= stop-flow-sol-at) or (stop-flow-sol-at = 0))) or (solutions-exit?))) [ assign-efficiency ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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? opportunity-here with [charged?] and any? problem-here with [postponed?]) [set pcolor brown] [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) [ ;; Paired agents enter the decision process on equal status with the others. ask problem-here [ if (postponed?) [ set postponed? false set to-opportunity nobody ] ] ask opportunity-here [ if (charged?) [ set charged? false set with-problem nobody ] ] ;; If there are problems as well, either they are resolved if their energy is sufficient or all agents stay put until another ;; opportunity passes by and takes a problem away. ifelse (any? problem-here) [ ;; If the sum of the energies 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 energies of all problems on the same patch, then decisions are made by ;; resolution. If the agents are required to exit after decision-making, all participants exit, but only the most efficient ;; solution exits and only the least important opportunity exits. ifelse ((sum [energy_par] of participant-here)*([efficiency] of max-one-of solution-here [efficiency]) >= (sum [energy_pro] of problem-here)) [ set n_resolution n_resolution + 1 ;; A decision by resolution is marked by a green square. set pcolor lime ;; Write information on the control center if (show-details?) [write-resolutions] ;; The indicators based on energy values must be computed here evaluate-used-energy evaluate-excess-energy ;; The indicators of the percentages of resolutions per importance must be computed here set chosenOppRes one-of opportunity-here evaluate-resolutions ;; 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 energy of the participants is not sufficient to make a decision, all agents on the patch are blocked until a choice ;; opportunity arrives, that takes away the problem with the highest energy. This flight may 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 set pcolor white ;; If there is more than one opportunity, this is left free to move and take away the problem with the highest energy. if (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 max-one-of problem-here [energy_pro] ;; Checks that there is at least one place to which the chosen opportunity can move. if ( (decision-structure = 0 and access-structure = 0) or (decision-structure = 0 and (access-structure = 1 and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 1 and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 1 and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 1 and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 1 and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 1 and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 1 and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 1 and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 2 and not any? (problem-on patch-at 1 0) with [problem_id != [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 2 and not any? (problem-on patch-at 0 1) with [problem_id != [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 2 and not any? (problem-on patch-at -1 0) with [problem_id != [opportunity_id] of which-opportunity])) or (decision-structure = 0 and (access-structure = 2 and not any? (problem-on patch-at 0 -1) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at 1 0) with [participant_id != [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 2 and not any? (participant-on patch-at 0 1) with [participant_id != [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 2 and not any? (participant-on patch-at -1 0) with [participant_id != [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 2 and not any? (participant-on patch-at 0 -1) with [participant_id != [opportunity_id] of which-opportunity]) and access-structure = 0) or ((decision-structure = 2 and not any? (participant-on patch-at 1 0) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at 1 0) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at 0 1) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at 0 1) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at -1 0) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at -1 0) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at 0 -1) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at 0 -1) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at 1 0) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at 1 0) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at 0 1) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at 0 1) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at -1 0) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at -1 0) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 2 and not any? (participant-on patch-at 0 -1) with [participant_id != [opportunity_id] of which-opportunity]) and (access-structure = 1 and not any? (problem-on patch-at 0 -1) with [problem_id > [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at 1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at 1 0) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at 0 1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at 0 1) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at -1 0) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at -1 0) with [problem_id != [opportunity_id] of which-opportunity])) or ((decision-structure = 1 and not any? (participant-on patch-at 0 -1) with [participant_id > [opportunity_id] of which-opportunity]) and (access-structure = 2 and not any? (problem-on patch-at 0 -1) with [problem_id != [opportunity_id] of which-opportunity])) ) [ ;; If yes, a flight takes place. set n_flight n_flight + 1 ;; A flight is marked by a setting back the color to black for a while. set pcolor black ;; The remaining agents may make a decision, either by resolution or by oversight. Note that, since the pair of problem ;; and opportunity are still in their places, the ensuing conditions take account of the fact that one more problem and ;; one more opportunity are there. ;; Eventually, the remaining problems may be solved by resolution. A counter of flights that are followed by decision-making ;; by resolution is updated, though the decision is made the next step. if ((count problem-here > 1) and ((sum [energy_par] of participant-here)*([efficiency] of max-one-of solution-here [efficiency]) >= (sum [energy_pro] of problem-here - [energy_pro] of max-one-of problem-here [energy_pro]))) [ set n_flight_res n_flight_res + 1 evaluate-jumps_par ] ;; Or, if no problem is left, a decision may be made by oversight. A counter of flights that are followed by decision-making ;; by oversight is updated, though the decision is made the next step. if (count problem-here <= 1) [ set n_flight_ove n_flight_ove + 1 evaluate-jumps_par ] ;; 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 ] ask which-problem [ set blocked? false set postponed? true set to-opportunity which-opportunity ] ] ] ] ] ;; 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 n_oversight n_oversight + 1 ;; A decision by oversight is marked by a sky-blue square. set pcolor sky ;; Write information on the control center if (show-details?) [write-oversights] ;; Used energy must be computed here evaluate-used-energy ;; The indicators of the percentages of oversights per importance must be computed here set chosenOppOve one-of opportunity-here evaluate-oversights ;; 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] ] ] ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;; THE REMAINING AGENTS ARE RE-NUMBERED if (participants-exit?) [ let i 0 repeat count participant [ if (not any? participant with [participant_id = i]) [ set [participant_id] of one-of participant with [participant_id >= count participant] i ] set i i + 1 ] ] if (opportunities-exit?) [ let i 0 repeat count opportunity [ if (not any? opportunity with [opportunity_id = i]) [ set [opportunity_id] of one-of opportunity with [opportunity_id >= count opportunity] i ] set i i + 1 ] ] if (solutions-exit?) [ let i 0 repeat count solution [ if (not any? solution with [solution_id = i]) [ set [solution_id] of one-of solution with [solution_id >= count solution] i ] set i i + 1 ] ] if (problems-exit?) [ let i 0 repeat count problem [ if (not any? problem with [problem_id = i]) [ set [problem_id] of one-of problem with [problem_id >= count problem] i ] set i i + 1 ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;; AND FINALLY MOVE ;; Agents are only allowed to turn by multiples of 90 degrees. ;; Participants may be constrained by the decision structure, problems may be constrained by the access structure, opportunities ;; may me constrained by both the decision and the access structure, whereas the movements of solutions are unconstrained. ;; Paired problems and opportunities move in the same direction, chosen randomly at each step for all of them. ;; Problems may move anywhere, because they are already coupled to an opportunity. On the contrary, opportunities should consider ;; whether they are moving onto patches where there are participants or additional problems with which they are not allowed to interact. ask patches [ 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 = 0) and (access-structure = 0)) or ((decision-structure = 1) and (not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = 0)) or ((decision-structure = 2) and (not any? (participant-on patch-ahead 1) with [participant_id != [opportunity_id] of myself]) and (access-structure = 0)) or ((decision-structure = 0) and (access-structure = 1) and (not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself])) or ((decision-structure = 0) and (access-structure = 2) and (not any? (problem-on patch-ahead 1) with [problem_id != [opportunity_id] of myself])) or ((decision-structure = 1) and (not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = 1) and (not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself])) or ((decision-structure = 1) and (not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = 2) and (not any? (problem-on patch-ahead 1) with [problem_id != [opportunity_id] of myself])) or ((decision-structure = 2) and (not any? (participant-on patch-ahead 1) with [participant_id != [opportunity_id] of myself]) and (access-structure = 1) and (not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself])) or ((decision-structure = 2) and (not any? (participant-on patch-ahead 1) with [participant_id != [opportunity_id] of myself]) and (access-structure = 2) and (not any? (problem-on patch-ahead 1) with [problem_id != [opportunity_id] of myself]))) [ set pcolor black move-to patch-at-heading-and-distance ((random 4) * 90) 1 set pcolor brown ] 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 ] ] ;; Uncoordinated agents move in different, randomly chosen directions. ;; However, only solutions are always allowed to move anywhere. In fact, participants must take account of the decision structure. ;; Problems must take account of the access structure. Finally, opportunities must take account of both the decision structure ;; and the access structure. ask participant with [not blocked?] [ set heading ((random 4) * 90) if ((decision-structure = 0) or ((decision-structure = 1) and (not any? (opportunity-on patch-ahead 1) with [opportunity_id < [participant_id] of myself])) or ((decision-structure = 2) 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 = 0) and (access-structure = 0)) or ((decision-structure = 1) and (not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = 0)) or ((decision-structure = 2) and (not any? (participant-on patch-ahead 1) with [participant_id != [opportunity_id] of myself]) and (access-structure = 0)) or ((decision-structure = 0) and (access-structure = 1) and (not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself])) or ((decision-structure = 0) and (access-structure = 2) and (not any? (problem-on patch-ahead 1) with [problem_id != [opportunity_id] of myself])) or ((decision-structure = 1) and (not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = 1) and (not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself])) or ((decision-structure = 1) and (not any? (participant-on patch-ahead 1) with [participant_id > [opportunity_id] of myself]) and (access-structure = 2) and (not any? (problem-on patch-ahead 1) with [problem_id != [opportunity_id] of myself])) or ((decision-structure = 2) and (not any? (participant-on patch-ahead 1) with [participant_id != [opportunity_id] of myself]) and (access-structure = 1) and (not any? (problem-on patch-ahead 1) with [problem_id > [opportunity_id] of myself])) or ((decision-structure = 2) and (not any? (participant-on patch-ahead 1) with [participant_id != [opportunity_id] of myself]) and (access-structure = 2) and (not any? (problem-on patch-ahead 1) with [problem_id != [opportunity_id] of myself]))) [ move-to patch-ahead 1 ] ] ask solution with [not blocked?] [ move-to patch-at-heading-and-distance ((random 4) * 90) 1 ] ask problem with [(not blocked?) and (not postponed?)] [ set heading ((random 4) * 90) if ((access-structure = 0) or ((access-structure = 1) and (not any? (opportunity-on patch-ahead 1) with [opportunity_id < [problem_id] of myself])) or ((access-structure = 2) and (not any? (opportunity-on patch-ahead 1) with [opportunity_id != [problem_id] of myself]))) [ move-to patch-ahead 1 ] ] ;;;;;;;;;;;; GRAPHICAL PROCEDURES display-labels-par ;; display the energy labels of participants display-labels-pro ;; display the energy labels of problems display-labels-sol ;; display the efficiency labels of solutions do-plots ;; plots diagrams general-indicators ;; computes a block of general indicators that appear at the bottom of the interface ;;;;;;;;;;;;;;;;;;;;;; VARIOUS UPDATINGS ;; 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 ] ;; The cumulative number of decisions is updated. set t_resolution (t_resolution + n_resolution) set t_oversight (t_oversight + n_oversight) set t_decision (t_resolution + t_oversight) set t_flight (t_flight + n_flight) set t_flight_res (t_flight_res + n_flight_res) set t_flight_ove (t_flight_ove + n_flight_ove) ;; The percentages of decisions per importance are updated. if ((opportunities-exit?) and ((decision-structure != 0) or (access-structure != 0)) and (t_decision > 0)) [ set percentOveI (countOveI * 100 / t_decision) set percentOveII (countOveII * 100 / t_decision) set percentOveIII (countOveIII * 100 / t_decision) set percentOveIV (countOveIV * 100 / t_decision) set percentResI (countResI * 100 / t_decision) set percentResII (countResII * 100 / t_decision) set percentResIII (countResIII * 100 / t_decision) set percentResIV (countResIV * 100 / t_decision) ] ;; The number of decisions in a tick is set down to zero. set n_resolution 0 set n_oversight 0 set n_flight 0 set n_flight_res 0 set n_flight_ove 0 end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;; Procedures to distribute energy to participants and problems, efficiency to solutions ;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to assign-energy-par if (dist-energy-par = 0) [ ifelse (count participant > 1) [ ask participant [set energy_par min-energy-par + participant_id / (count participant - 1) * (max-energy-par - min-energy-par)] ] [ ask participant [set energy_par (min-energy-par + max-energy-par) / 2] ] ] if (dist-energy-par = 1) [ ask participant [set energy_par random-float (max-energy-par - min-energy-par) + min-energy-par] ] if (dist-energy-par = 2) [ ifelse (count participant > 1) [ ask participant [set energy_par min-energy-par + (count participant - 1 - participant_id) / (count participant - 1) * (max-energy-par - min-energy-par)] ] [ ask participant [set energy_par (min-energy-par + max-energy-par) / 2] ] ] end to assign-efficiency if (dist-efficiency = 0) [ 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] ] ] if (dist-efficiency = 1) [ ask solution [set efficiency random-float (max-efficiency - min-efficiency) + min-efficiency] ] if (dist-efficiency = 2) [ 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] ] ] end to assign-energy-pro if (dist-energy-pro = 0) [ ifelse (count problem > 1) [ ask problem [set energy_pro min-energy-pro + problem_id / (count problem - 1) * (max-energy-pro - min-energy-pro)] ] [ ask problem [set energy_pro (max-energy-pro - min-energy-pro) / 2] ] ] if (dist-energy-pro = 1) [ ask problem [set energy_pro random-float (max-energy-pro - min-energy-pro) + min-energy-pro] ] if (dist-energy-pro = 2) [ ifelse (count problem > 1) [ ask problem [set energy_pro min-energy-pro + (count problem - 1 - problem_id) / (count problem - 1) * (max-energy-pro - min-energy-pro)] ] [ ask problem [set energy_pro (min-energy-pro + max-energy-pro) / 2] ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; If participants, choice opportunities, solutions or problems exit after a decision is made, these procedures are acvtivated ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Participants and solutions are just killed. Opportunities and problems may need to be disentangled from one another. to kill [morituri] if (morituri != nobody) [ ask morituri [ 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 (breed = problem) [ if (postponed?) [ let this-opportunity to-opportunity if (any? opportunity with [who = this-opportunity]) [ ask this-opportunity [ set charged? false set with-problem nobody ] ] ] ] die ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; If "show energy" is ON, it writes a label close to each turtle displaying its energy or efficiency ;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to display-labels-par if show-energy-par? [ ask participant [ set label round energy_par ] ] end to display-labels-pro if show-energy-pro? [ ask problem [ set label round energy_pro ] ] end to display-labels-sol if show-efficiency? [ ask solution [ set label precision efficiency 1 ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Plots diagrams ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to do-plots ;; Plotting current decisions. set-current-plot "Current Decisions / Current Flights" set-current-plot-pen "Resolutions" plot n_resolution set-current-plot-pen "Oversights" plot n_oversight set-current-plot-pen "Flights" plot n_flight ;; Plotting the energy balance. set-current-plot "Energy Balance" set-current-plot-pen "Potential Energy of Participants" plot sum [energy_par] of participant set-current-plot-pen "Effective Energy of Participants" ifelse (count solution > 0) [ plot (sum [energy_par] of participant) * (sum [efficiency] of solution) / (count solution) ] [ plot 0 ] set-current-plot-pen "Energy Required by Problems" plot sum [energy_pro] of problem end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Calculates indicators ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to general-indicators ;; Number of unresolved problems. Same as the number of problems if they do not exit the model, minus the ;; initial number of problems. ifelse (problems-exit?) [ set unsolved_problems count problem ] [ set unsolved_problems "not available" ] ;; The number of times a problem changes opportunity. This is equivalent to the number of flights. set problem_jumps t_flight ;; The number of times a problem cannot be solved because blocked or taken away by an opportunity, summed over problems. ;; Equivalent to the cumulative number of blocked or postponed problems. ask problem [ if ((blocked?) or (postponed?)) [ set problem_bindings problem_bindings + 1 ] ] ;; The number of times a problem is neither blocked or taken away by an opportunity, summed over problems. ;; Equivalent to the difference between the number of problems and the previous indicator, summed over time. set cumulative_problems cumulative_problems + count problem set problem_latency cumulative_problems - problem_bindings ;; The number of times a participant cannot make a decision because blocked, summed over participants. Equivalent to the ;; cumulative number of blocked participants. ask participant [ if (blocked?) [ set participant_bindings participant_bindings + 1 ] ] ;; The number of non-exploited opportunities. Same as the number of opportunities if they do not exit the model, ;; minus the initial number of opportunities. ifelse (opportunities-exit?) [ set unexploited_opportunities count opportunity ] [ set unexploited_opportunities "not available" ] ;; The lifespan of opportunities, if they may exit the simulation, measures the waiting time before decisions are made. ifelse (opportunities-exit?) [ set waiting_time waiting_time + count opportunity ] [ set waiting_time "not available" ] end to evaluate-used-energy ;; The energy of the participants involved in decision-making. Also this indicator is calculated at another place, i.e. ;; where decision is made, either by oversight or by resolution. The variable is "used_energy". set used_energy used_energy + (sum [energy_par] of participant-here) end to evaluate-excess-energy ;; The excess energy, measured as the energy of the participants involved in decision-making, weighted by the efficiency ;; of the solution that they employ, minus the energy of the problems that are eventually solved. Also calculated where ;; decision by resolution is made. The variable is "excess_energy". set excess_energy excess_energy + ((sum [energy_par] of participant-here)*([efficiency] of max-one-of solution-here [efficiency]) - sum [energy_pro] of problem-here) end to evaluate-jumps_par ;; The number of times that a participant leaves an opportunity. This happens when a flight causes decision-making, ;; either by resolution or by oversight. It is not equivalent to the number of flights that cause decision-making ;; because it is multiplied by the number of participants involved. This indicator is computed at the same place where the ;; number of flights that cause decision-making are computed. The variable is "participant_jumps". ifelse (not participants-exit?) [ set participant_jumps participant_jumps + count participant-here ] [ set participant_jumps "not available" ] end to evaluate-resolutions ;; The number of resolutions made by choice opportunities of different importance. Importance is subdivided into four classes ;; in which the opportunities available at any point in time are classified. if ((opportunities-exit?) and ((decision-structure != 0) or (access-structure != 0))) [ if ([opportunity_id] of chosenOppRes < (count opportunity) * 0.25) [ set countResI countResI + 1 ] if (([opportunity_id] of chosenOppRes >= (count opportunity) * 0.25) and ([opportunity_id] of chosenOppRes < (count opportunity) * 0.5)) [ set countResII countResII + 1 ] if (([opportunity_id] of chosenOppRes >= (count opportunity) * 0.5) and ([opportunity_id] of chosenOppRes < (count opportunity) * 0.75)) [ set countResIII countResIII + 1 ] if (([opportunity_id] of chosenOppRes >= (count opportunity) * 0.75) and ([opportunity_id] of chosenOppRes < count opportunity)) [ set countResIV countResIV + 1 ] ] end to evaluate-oversights ;; The number of oversights made by choice opportunities of different importance. Importance is subdivided into four classes ;; in which the opportunities available at any point in time are classified. if ((opportunities-exit?) and ((decision-structure != 0) or (access-structure != 0))) [ if ([opportunity_id] of chosenOppOve < (count opportunity) * 0.25) [ set countOveI countOveI + 1 ] if (([opportunity_id] of chosenOppOve >= (count opportunity) * 0.25) and ([opportunity_id] of chosenOppOve < (count opportunity) * 0.5)) [ set countOveII countOveII + 1 ] if (([opportunity_id] of chosenOppOve >= (count opportunity) * 0.5) and ([opportunity_id] of chosenOppOve < (count opportunity) * 0.75)) [ set countOveIII countOveIII + 1 ] if (([opportunity_id] of chosenOppOve >= (count opportunity) * 0.75) and ([opportunity_id] of chosenOppOve < count opportunity)) [ set countOveIV countOveIV + 1 ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;; Writes information on decision-making on the command center ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to write-oversights type "OVERSIGHT" ask participant-here [ type " Participant:" write participant_id type " Out of:" write count participant type " Born as:" write id_at_birth type " At step:" write date_of_birth ] ask opportunity-here [ type " Opportunity:" write opportunity_id type " Out of:" write count opportunity type " Born as:" write id_at_birth type " At step:" write date_of_birth ] ask solution-here [ type " Solution:" write solution_id type " Out of:" write count solution type " Born as:" write id_at_birth type " At step:" write date_of_birth ] print " " end to write-resolutions type "RESOLUTION" ask participant-here [ type " Participant:" write participant_id type " Out of:" write count participant type " Born as:" write id_at_birth type " At step:" write date_of_birth ] ask opportunity-here [ type " Opportunity:" write opportunity_id type " Out of:" write count opportunity type " Born as:" write id_at_birth type " At step:" write date_of_birth ] ask solution-here [ type " Solution:" write solution_id type " Out of:" write count solution type " Born as:" write id_at_birth type " At step:" write date_of_birth ] ask problem-here [ type " Problem:" write problem_id type " Out of:" write count problem type " Born as:" write id_at_birth type " At step:" write date_of_birth ] print " " end to write-survivors print "" type "SURVIVING PARTICIPANTS" print "" ifelse (any? participant) [ type "Identities:" ask participant [ write participant_id ] print " " type "Identities at birth:" ask participant [ write id_at_birth ] print " " ] [ type "none" ] type "SURVIVING OPPORTUNITIES" print "" ifelse (any? opportunity) [ type "Identities:" ask opportunity [ write opportunity_id ] print " " type "Identities at birth:" ask opportunity [ write id_at_birth ] print " " ] [ type "none" ] type "SURVIVING SOLUTIONS" print "" ifelse (any? solution) [ type "Identities:" ask solution [ write solution_id ] print " " type "Identities at birth:" ask solution [ write id_at_birth ] print " " ] [ type "none" ] type "SURVIVING PROBLEMS" print "" ifelse (any? problem) [ type "Identities:" ask problem [ write problem_id ] print " " type "Identities at birth:" ask problem [ write id_at_birth ] print " " ] [ type "none" ] print "" end @#$#@#$#@ GRAPHICS-WINDOW 450 10 1454 978 17 16 28.4 1 10 1 1 1 0 1 1 1 -17 17 -16 16 0 0 1 ticks CC-WINDOW 5 992 1463 1087 Command Center 0 SLIDER 9 281 208 314 net-flow-of-problems net-flow-of-problems -5 5 4 0.1 1 NIL HORIZONTAL SLIDER 9 116 208 149 initial-number-of-opportunities initial-number-of-opportunities 0 500 0 1 1 NIL HORIZONTAL SLIDER 9 50 208 83 initial-number-of-participants initial-number-of-participants 0 500 100 1 1 NIL HORIZONTAL BUTTON 173 10 228 43 Set Up setup NIL 1 T OBSERVER NIL NIL NIL NIL MONITOR 372 172 445 217 problems count problem 0 1 11 MONITOR 372 127 445 172 solutions count solution 0 1 11 BUTTON 283 10 348 43 Go Until go T 1 T OBSERVER NIL NIL NIL NIL BUTTON 228 10 283 43 Go Step go NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 300 364 445 397 min-energy-pro min-energy-pro 0 10 1.5 0.1 1 NIL HORIZONTAL SLIDER 155 364 300 397 min-efficiency min-efficiency 0 1 1 0.1 1 NIL HORIZONTAL SLIDER 9 364 155 397 min-energy-par min-energy-par 0 10 1 0.1 1 NIL HORIZONTAL PLOT 9 707 341 840 Current Decisions / Current Flights step NIL 0.0 100.0 0.0 1.0 true true PENS "Resolutions" 1.0 0 -13840069 true "Oversights" 1.0 0 -13791810 true "Flights" 1.0 0 -6459832 true MONITOR 155 468 300 513 Decisions by Resolution t_resolution 0 1 11 MONITOR 9 468 155 513 Decisions by Oversight t_oversight 0 1 11 SWITCH 9 430 155 463 show-energy-par? show-energy-par? 1 1 -1000 SLIDER 9 215 208 248 net-flow-of-solutions net-flow-of-solutions -5 5 0 0.1 1 NIL HORIZONTAL SLIDER 9 83 208 116 net-flow-of-participants net-flow-of-participants -5 5 0 0.1 1 NIL HORIZONTAL MONITOR 372 37 445 82 participants count participant 0 1 11 SLIDER 9 149 208 182 net-flow-of-opportunities net-flow-of-opportunities -5 5 2 0.1 1 NIL HORIZONTAL MONITOR 372 82 445 127 opportunities count opportunity 0 1 11 SLIDER 9 182 208 215 initial-number-of-solutions initial-number-of-solutions 0 500 100 1 1 NIL HORIZONTAL SLIDER 9 248 208 281 initial-number-of-problems initial-number-of-problems 0 500 0 1 1 NIL HORIZONTAL SWITCH 208 50 348 83 participants-exit? participants-exit? 1 1 -1000 SWITCH 208 116 348 149 opportunities-exit? opportunities-exit? 0 1 -1000 SWITCH 208 182 348 215 solutions-exit? solutions-exit? 1 1 -1000 SWITCH 208 248 348 281 problems-exit? problems-exit? 0 1 -1000 SLIDER 9 397 155 430 max-energy-par max-energy-par 0 10 1 0.1 1 NIL HORIZONTAL SLIDER 300 397 445 430 max-energy-pro max-energy-pro 0 10 1.5 0.1 1 NIL HORIZONTAL SLIDER 155 397 300 430 max-efficiency max-efficiency 0 1 1 0.1 1 NIL HORIZONTAL MONITOR 300 513 445 558 Total Flights t_flight 0 1 11 SWITCH 300 430 445 463 show-energy-pro? show-energy-pro? 1 1 -1000 SWITCH 155 430 300 463 show-efficiency? show-efficiency? 1 1 -1000 CHOOSER 9 319 155 364 dist-energy-par dist-energy-par 0 1 2 1 CHOOSER 300 319 445 364 dist-energy-pro dist-energy-pro 0 1 2 1 CHOOSER 155 319 300 364 dist-efficiency dist-efficiency 0 1 2 1 CHOOSER 351 269 445 314 access-structure access-structure 0 1 2 1 CHOOSER 351 224 445 269 decision-structure decision-structure 0 1 2 1 MONITOR 336 565 445 610 Unsolved Problems unsolved_problems 0 1 11 MONITOR 9 565 118 610 Problem Jumps problem_jumps 0 1 11 MONITOR 227 565 336 610 Problem Bindings problem_bindings 0 1 11 MONITOR 118 565 227 610 Problem Latency problem_latency 0 1 11 SLIDER 9 10 173 43 stop-at stop-at 0 1000 200 1 1 NIL HORIZONTAL MONITOR 118 610 227 655 Participant Bindings participant_bindings 0 1 11 MONITOR 9 610 118 655 Participant Jumps participant_jumps 0 1 11 MONITOR 227 610 336 655 Used Energy used_energy 2 1 11 MONITOR 336 610 445 655 Excess Energy excess_energy 2 1 11 MONITOR 9 655 118 700 Unexploited Opportunities unexploited_opportunities 0 1 11 MONITOR 118 655 227 700 Waiting Time waiting_time 0 1 11 PLOT 9 845 445 978 Energy Balance step NIL 0.0 100.0 0.0 10.0 true true PENS "Potential Energy of Participants" 1.0 0 -2674135 true "Effective Energy of Participants" 1.0 0 -955883 true "Energy Required by Problems" 1.0 0 -16777216 true SLIDER 208 83 348 116 stop-flow-par-at stop-flow-par-at 0 200 0 1 1 NIL HORIZONTAL SLIDER 208 149 348 182 stop-flow-opp-at stop-flow-opp-at 0 200 100 1 1 NIL HORIZONTAL SLIDER 208 215 348 248 stop-flow-sol-at stop-flow-sol-at 0 200 0 1 1 NIL HORIZONTAL SLIDER 208 281 348 314 stop-flow-pro-at stop-flow-pro-at 0 200 100 1 1 NIL HORIZONTAL SWITCH 228 667 344 700 show-details? show-details? 1 1 -1000 MONITOR 345 660 395 705 %O-I percentOveI 3 1 11 MONITOR 345 705 395 750 %O-II percentOveII 3 1 11 MONITOR 345 750 395 795 %O-III percentOveIII 3 1 11 MONITOR 345 795 395 840 %O-IV percentOveIV 3 1 11 MONITOR 395 660 445 705 %R-I percentResI 3 1 11 MONITOR 395 705 445 750 %R-II percentResII 3 1 11 MONITOR 395 750 445 795 %R-III percentResIII 3 1 11 MONITOR 395 795 445 840 %R-IV percentResIV 3 1 11 MONITOR 9 513 155 558 Flights causing Oversights t_flight_ove 17 1 11 MONITOR 155 513 300 558 Flights causing Resolutions t_flight_res 17 1 11 MONITOR 300 468 445 513 Total Decisions t_decision 17 1 11 @#$#@#$#@ WHAT IS IT? ------------ The Garbage Can Model of Organizational Choice (Cohen, March and Olsen 1972) is the most famous model of organizational decision-making. With this code, we reproduced the original Garbage Can model in an agent-based setting (Fioretti and Lomi 2008a, 2008b). In the Garbage Can model, decision is made when the members of an organization apply a solution to an opportunity for making a choice. Note that solutions exist before problems, and that decisions can be made even without solving any problem. Eventually, a problem may be there to be solved, but this is not necessarily the case. In this decision process, choice opportunities take the role of "garbage cans" where solutions and problems are dumped. Hence the name of the model. The GCM can be seen as a sort of chemical reactor where participants (decision-makers), opportunities, solutions and problems have been dumped. Through random meetings of these elements, decisions are made. We interpreted the GCM as an agent-based model where participants, opportunities, solutions and problems are four classes of agents. Participants are denoted by yellow men. Opportunities are denoted by orange squares. Solutions are denoted by red circles. Problems are denoted by violet triangles. An organization starts its life with a given number of participants, choice opportunities, solutions and problems. These initial values are set by means of the parameters "initial-number-of-participants", "initial-number-of-opportunities", initial-number-of-solutions" and "initial-number-of-problems", respectively. These parameters may take any integer value greater or equal than zero. Eventually, an organization may want to attract or expel participants, opportunities, solutions and problems in the course of its life. The corresponding net input-output flows are set by means of the parameters "net-flow-of-participants", "net-flow-of-opportunities", "net-flow-of-solutions" and "net-flow-of-problems", respectively. If these parameters are greater than zero, the organization attracts participants, choice opportunities, solutions or problems. If these parameters are less than zero, the organization expels participants, choice opportunities, solutions or problems into the environment. If these parameters are zero, the flows between the organization and its environment compensate one another. Since, as we shall see, an organization may destroy participants, opportunities, solutions or problems in order to make a decision, the net flows of these three classes of agents may be required to be positive in order for an organization to be viable in the long run. The parameters "net-flow-of-participants", "net-flow-of-opportunities", "net-flow-of-solutions" and "net-flow-of-problems" take values in the [-5, 5] interval in decimal steps. If they take integer values, they denote the number of participants, opportunities, solutions or problems that enter or exit the organization at each step. If they have a decimal component, this denotes an additional number of agents that enter or exit the organization every 10 steps. For instance, "net-flow-of-participants = 3.4" means that in general 3 participants enter the organization at every time step, but 7 participants enter the organization every ten time steps. The switches "stop-flow-par-at", "stop-flow-opp-at", "stop-flow-sol-at" and "stop-flow-pro-at" enable the user to stop these flows after a selected number of simulation steps. These parameters are ineffective when they are set to zero. Participants, opportunities, solutions and problems may be required to exit the organization after decision-making. This option is chosen by means of the parameters "participants-exit?", "opportunities-exit?", "solutions-exit?" and "problems-exit?", respectively. If the switch "participants-exit?" is ON, on each patch where a decision is made, all participants exit. This reflects the idea that all of them are involved in decision-making, be it resolution or overflight. If the switch "opportunities-exit?" is ON, on each patch where a decision is made only one opportunity exits. This is chosen at random among the opportunities on the patch. The underlying idea is that decision-making requires only one choice opportunity. If the switch "solutions-exit?" is ON, on each patch where a decision is made only one solution exits. The underlying idea is that even when decision-making involves many participants and solves several problems, only one solution is applied. If the decision is made by resolution, the chosen solution is the one with highest efficiency. If the decision is made by oversight, a solution is selected at random among those on the patch. Finally, the switch "problems-exit?" is only effective when decisions are made by resolution. If it is ON, all problems on patches where a decision is made, exit. Participants, choice opportunities, solutions and problems walk freely on the model space if both "decision-structure = 0" and "access-structure = 0". If "decision-structure = 1" participants and choice opportunities are ranked in order of importance and participants are only allowed to move on to opportunities of less or equal importance. If "decision-structure = 2" participants are only allowed to move on to opportunities of equal importance. If "access-structure = 1" problems and opportunities are ranked in order of importance and problems are only allowed to move on to opportunities of less or equal importance. If "access-structure = 2" problems are only allowed to move on to opportunities of equal importance. Participants are characterized by their ability in solving problems (henceforth "energy-par"). Solutions are characterized by their efficiency. Problems are characterized by their difficulty (henceforth, "energy-pro"). Energy and efficiency take values within a range specified by the sliders "min-energy-par" and "max-energy-par", "min-efficiency" and "max-efficiency", "min-energy-pro" and "max-energy-pro", respectively. Energy and efficiency can be assigned according to one of the three following criteria that can be chosen by means of the sliders "dist-energy-par", "dist-efficiency" and "dist-energy-pro", respectively: 0) The participants, problems or solutions with lowest identification number (conventionally, the most important participants, problems and solutions in the organization) receive the lowest values of energy or efficiency; 1) The values of energy and efficiency are assigned at random according to a uniform distribution that spans the range between minimum and maximum values; 2) The participants, problems or solutions with lowest identification number (conventionally, the most important participants, problems and solutions in the organization) receive the highest values of energy or efficiency. A problem is solved when a participant has enough personal energy and a sufficiently efficient solution such that their product is greater or equal to the energy of the problem. Intuitively, this process is analogous to that of a machine that transforms potential energy into kinetic energy. For instance, a car extracts potential energy from gasoline (the "energy" of the decision-maker) wasting a certain fraction of it (the "efficiency" of the solution) in order to cover a distance (the "energy" of the problem). When problems are solved, decision is made "by resolution". However, a key feature of the Garbage Can model is that a lot of decision-making may not solve any problem at all. For instance, choice opportunities may be used as showrooms in corporate politics rather than as occasions to solve problems. In these cases, decision is made "by oversight". In the model, decision-making takes place when participants, choice opportunities, solutions and eventually problems happen to be on the same patch. Decision-making by resolution takes place when at least one participant, at least one choice opportunity, at least one solution, at least one problem are on the same patch and the sum of the energies of the participants on the patch, multiplied by the efficiency of the most efficient solution on the patch, is greater or equal to the sum of the energies of the problems on the patch. Most often, decision-making by resolution occurs when just one participant, one choice opportunity, one solution and one problem happen to be on the same patch and the energy of the participant, multiplied by the efficiency of the solution that she is using, is greater or equal to the energy of the problem. Decision-making by resolution is marked by a green square. Decision-making by oversight takes place when at least one participant, at least one choice opportunity and at least one solution are on the same patch. No problem must be there to be solved, and no energy balance is required. Thus, decision-making by oversight occurs most often when a participant, a solution and a choice opportunity happen to be on the same patch. Decision-making by oversight is marked by a sky-blue square. If problems are on a patch with participants, solutions and choice opportunities, but the energy of the participants and the efficiency of the solutions is not sufficient to solve the problems, all agents on the patch are blocked and no decision is made. Blocked decision processes are marked by a white square. However, if there is more than one choice opportunity on the patch, or if an additional opportunity just walks on a patch where decision is blocked, then the least important opportunity takes away the problem with the highest energy and walks together with it until they find a participant and a solution that are able to solve the problem. This is called a "flight" from a problem. During a flight, the color of the square where a decision process is blocked is set back to black. The opportunity and its problem move away together, and they are marked by a brown square. Once the most difficult problem left, the blocked participants may be able to make a decision, either by resolution or by oversight. Thus, flight is very important in organizational decision-making. It represents all situations where a difficult problem is postponed in order to face other issues. The four monitors "participants", "opportunities", "solutions" and "problems" report the cumulative number of the corresponding agents. They reflect both net flows and deaths. The monitor "Decisions by Resolution" reports the cumulative number of decisions that are made by resolution. The monitor "Decisions by Oversight" reports the cumulative number of decisions that are made by oversight. The graph reports the number of decisions by resolution and by oversight that are made at each tick. The monitor "Total Flights" reports the cumulative number of times that a problem flied away with another opportunity. Sometimes, a flight enables decision-making for the remaining agents. The monitor "Flights that cause Resolutions" reports the number of flights that enabled decision-making by resolution. The monitor "Flights that cause Oversights" reports the number of flights that enabled decision-making by oversight. Thus, the sum of "Flights that cause Resolutions" and "Flights that cause Oversights" is less or equal to "Total Flights". Note that, since decision is made one tick after a flight, the decisions caused by a flight may not reflect in the monitors "Decisions by Resolution" and "Decisions by Oversight" if the simulation is stopped just after a flight. Also note that, if "decision-structure" and "access-structure" are not set to 0, it may happen that an opportunity hinders the way of an opportunity that wants to fly. In this (very unlikely) case, the monitors "Flights that cause Resolutions" and "Flights that cause oversights" do not actually cause flights or oversights, respectively. The Garbage Can model comes with the following indicators: Problem Jumps The number of times a problem jumps from one opportunity onto another one. This indicator is equivalent to the number of flights; it has been added for compatibility with Cohen, March and Olsen's model. Problem Bindings The length of time a problem cannot be solved, either because it is bound to participants with too low energy or because it is flying away with an opportunity, summed over all problems. Problem Latency The length of time a problem is not bound to an opportunity, summed over all problems. Unsolved Problems If problems exit when a decision is made, then the number of problems in the simulation denotes the number of unresolved problems. This indicator is not available if the parameter "problems-exit?" is OFF. Participant Jumps The number of times a participant leaves an opportunity after staying some time with it. This happens because of a flight. However, this indicator is not equivalent to the number of flights that cause decision-making because several participents may be involved. Participant Bindings The length of time a participant cannot make a decision because involved in problems for which she does not have sufficient energy, summed over all participants. Used Energy The cumulative energy used by all participants involved in decision-making, both by resolution and by oversight. Excess Energy The difference between the cumulative energy used by all participants who resolved problems, multiplied by the efficiency of the solution that they employed, and the cumulative energy of all the problems that they solved. Unexploited Opportunities If opportunities exit when a decision is made, then the number of opportunities in the simulation denotes the number of unexploited occasions for making a choice. This indicator is not available if the parameter "opportunities-exit?" is OFF. Waiting Time If opportunities exit when a decision is made, then the time they spend in the organization measures the time before a decision was made. This indicator is the cumulative lifespan summed over all opportunities. It is not available if the parameter "opportunities-exit?" is OFF. Furthermore, the fraction of decisions made by oversight and resolution is disaggregated with respect to the importance of choice opportunities. If the decision structure is either hierarchical or specialized participants have a degree of importance, meaning that only certain participants are allowed to make use of certain opportunities. Likewise, if the access structure is either hierarchical or specialized problems have a degree of importance, meaning that only certain problems gain access to certain choice opportunities. In both cases, choice opportunities need to be ordered by their importance as well. Thus, the importance of choice opportunities can be used to rank decision-making both when the decision structure is hierarchical or specialized and when the access structure is hierarchical or specialized. The degree of importance of opportunities, just like the degree of importance of participants and problems, is indicated by their identification number. The lowest numbered opportunities are the most important ones. Since the number of opportunities may vary during a simulation, classes of importance are defined in percent terms with respect to the current population of opportunities. Four classes are defined, entailing one fourth of all opportunities each. The indicators that appear at the bottom right of the interface have the following meaning: - %O-I reports the percent of decisions by oversight over total decisions, that are made on opportunities in first class of importance. Class I entails one fourth of all opportunities, the most important ones. - %O-II reports the percent of decisions by oversight over total decisions, that are made on opportunities in the second class of importance. Class II entails one fourth of all opportunities, just less important than those of class I. - %O-III reports the percent of decisions by oversight over total decisions, that are made on opportunities in the third class of importance. Class III entails one fourth of all opportunities, less important than those of class II and yet not the least important ones. - %O-IV reports the percent of decisions by oversight over total decisions, that are made on opportunities in the fourth class of importance. Class IV entails one fourth of all opportunities, the least important ones. - %R-I reports the percent of decisions by resolution over total decisions, that are made on opportunities in first class of importance. Class I entails one fourth of all opportunities, the most important ones. - %R-II reports the percent of decisions by resolution over total decisions, that are made on opportunities in the second class of importance. Class II entails one fourth of all opportunities, just less important than those of class I. - %R-III reports the percent of decisions by resolution over total decisions, that are made on opportunities in the third class of importance. Class III entails one fourth of all opportunities, less important than those of class II and yet not the least important ones. - %R-IV reports the percent of decisions by resolution over total decisions, that are made on opportunities in the fourth class of importance. Class IV entails one fourth of all opportunities, the least important ones. These indicators are not available if opportunities do not exit after decision-making or both the decision structure and the access structure are non segmented. Even if these conditions are satisfied, they remain unavailable until at least one decision is made. Additional information on decision-making can be obtained by switching on "show-details?". If "show-details?" is ON, each time a decision is made a line is printed on the Command Center. Each line says whether the decision was made by oversight or resolution, which agents it involved according to current numbering, which was their identification number at the time they were created as well as the time step when they were created. If the simulation stops because the step specified by "stops-at" is reached, information on the current and original identification numbers of surviving agents is written on the Command Center. If this option is chosen it is advisable to enlarge the Command Center. Finally, the following graphs are available: - Current number of decisions by resolution, current number of decisions by oversight and current number of flights at each simulation step; - Total potential energy available to participants, total effective energy available to participants and total energy required by problems at each simulation step. Total effective energy is defined as the total potential energy multiplied by the average of the efficiency of solutions. HOW TO USE IT -------------- The population of participants, opportunities, solutions and problems should collectively not exceed 1000 units, unless the simulation space is enlarged. Conversely, at least a few tens of each breed are needed in order to obtain interesting outcomes. The energy of problems should not be too different to the energy of participants multiplied by the efficiency of solutions. Depending on energy configuration, maximum differences of one or two units are recommended. With hierarchical or specialized decision structures or access structures, the number of decisions and particularly the number of decisions by resolution tends to be small. Thus, it is advisable to run the model with many opportunities, many problems, sufficiently high values of participant energy, sufficiently high values of solution efficiency and sufficiently low values of problem energy. THINGS TO NOTICE ---------------- The most important and most robust conclusion of the Garbage Can model is that most decisions are made by oversight, few problems are solved and flight is widespread. A large number of flights do not cause decision-making. Most, but not all configurations are such that flights that cause decisions by oversight are many more than the flights causing decisions by resolution. The energy of problems affects all the above indicators, all of which measure some aspect of the difficulty of decision-making. Energy distribution influences the outcome of decision-making as well. Another interesting conclusion is that the most important opportunities are less likely to solve problems than the least important opportunities. This can be seen by experimenting with hierarchical decision and access structures. THINGS TO TRY ------------ The default values of parameters have been chosen in order to resemble the original model by Cohen, March and Olsen as closely as possible. The user is invited to move away fron default values exploring alternative combinations. The user can try different combinations of: 1) Population, through the initial number of participants, opportunities, solutions and problems, their flows in or out of the organization and the time when these flows stop; 2) Structures of interaction, through the decision structure and the access structure; 3) Energy endowments, through minimum and maximum values as well as their distribution. EXTENDING THE MODEL ------------------- This is an agent-based version of the original Garbage Can model. A common criticism of this model is that organizational structures (decision structure, access structure) are not endogenous, which is weird for a model of organizational decision-making. In subsequent variations of the original model, we shall overcome this shortcoming. NETLOGO FEATURES ---------------- This version runs on NetLogo 4.0.4. The previous version, also available under the rubric "User Community Models", was developed on NetLogo 2.1.0. With respect to the previous version, the following changes have been made: - Agents stay always at the center of their patch; - Colored patches mark resolutions, oversights, blocked decision processes and opportunities bound to problems; - Participants, opportunities, solutions and problems are represented as in more advanced versions of the model. The following bugs have been fixed: - Opportunities and problems bound to one another did not really move together; - Negative flows of agents (outflows) caused the model crash; - Energy and efficiency were not properly assigned; - Flights were overcounted when a structure was imposed; - The recognition of the importance of participants, opportunities and problems was flawn. CREDITS AND REFERENCES ---------------------- Cohen M.D., March J.G. and Olsen J.P. (1972) A Garbage Can Model of Organizational Choice. Administrative Science Quarterly, 17 (1): 1-25. Fioretti G. and Lomi A. (2008a) The Garbage Can Model of Organizational Choice: An agent-based reconstruction. Simulation Modelling Practice and Theory, 16 (): 192-217. Fioretti G. and Lomi A. (2008b) An Agent-Based Representation of the Garbage Can Model of Organizational Choice. Journal of Artificial Societies and Social Simulation, 11. This model was built by: Guido Fioretti University of Bologna @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 ant true 0 Polygon -7500403 true true 136 61 129 46 144 30 119 45 124 60 114 82 97 37 132 10 93 36 111 84 127 105 172 105 189 84 208 35 171 11 202 35 204 37 186 82 177 60 180 44 159 32 170 44 165 60 Polygon -7500403 true true 150 95 135 103 139 117 125 149 137 180 135 196 150 204 166 195 161 180 174 150 158 116 164 102 Polygon -7500403 true true 149 186 128 197 114 232 134 270 149 282 166 270 185 232 171 195 149 186 Polygon -7500403 true true 225 66 230 107 159 122 161 127 234 111 236 106 Polygon -7500403 true true 78 58 99 116 139 123 137 128 95 119 Polygon -7500403 true true 48 103 90 147 129 147 130 151 86 151 Polygon -7500403 true true 65 224 92 171 134 160 135 164 95 175 Polygon -7500403 true true 235 222 210 170 163 162 161 166 208 174 Polygon -7500403 true true 249 107 211 147 168 147 168 150 213 150 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 bee true 0 Polygon -1184463 true false 151 152 137 77 105 67 89 67 66 74 48 85 36 100 24 116 14 134 0 151 15 167 22 182 40 206 58 220 82 226 105 226 134 222 Polygon -16777216 true false 151 150 149 128 149 114 155 98 178 80 197 80 217 81 233 95 242 117 246 141 247 151 245 177 234 195 218 207 206 211 184 211 161 204 151 189 148 171 Polygon -7500403 true true 246 151 241 119 240 96 250 81 261 78 275 87 282 103 277 115 287 121 299 150 286 180 277 189 283 197 281 210 270 222 256 222 243 212 242 192 Polygon -16777216 true false 115 70 129 74 128 223 114 224 Polygon -16777216 true false 89 67 74 71 74 224 89 225 89 67 Polygon -16777216 true false 43 91 31 106 31 195 45 211 Line -1 false 200 144 213 70 Line -1 false 213 70 213 45 Line -1 false 214 45 203 26 Line -1 false 204 26 185 22 Line -1 false 185 22 170 25 Line -1 false 169 26 159 37 Line -1 false 159 37 156 55 Line -1 false 157 55 199 143 Line -1 false 200 141 162 227 Line -1 false 162 227 163 241 Line -1 false 163 241 171 249 Line -1 false 171 249 190 254 Line -1 false 192 253 203 248 Line -1 false 205 249 218 235 Line -1 false 218 235 200 144 bird1 false 0 Polygon -7500403 true true 2 6 2 39 270 298 297 298 299 271 187 160 279 75 276 22 100 67 31 0 bird2 false 0 Polygon -7500403 true true 2 4 33 4 298 270 298 298 272 298 155 184 117 289 61 295 61 105 0 43 boat1 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6459832 true false 150 32 157 162 Polygon -13345367 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7500403 true true 158 33 230 157 182 150 169 151 157 156 Polygon -7500403 true true 149 55 88 143 103 139 111 136 117 139 126 145 130 147 139 147 146 146 149 55 boat2 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6459832 true false 150 32 157 162 Polygon -13345367 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7500403 true true 157 54 175 79 174 96 185 102 178 112 194 124 196 131 190 139 192 146 211 151 216 154 157 154 Polygon -7500403 true true 150 74 146 91 139 99 143 114 141 123 137 126 131 129 132 139 142 136 126 142 119 147 148 147 boat3 false 0 Polygon -1 true false 63 162 90 207 223 207 290 162 Rectangle -6459832 true false 150 32 157 162 Polygon -13345367 true false 150 34 131 49 145 47 147 48 149 49 Polygon -7500403 true true 158 37 172 45 188 59 202 79 217 109 220 130 218 147 204 156 158 156 161 142 170 123 170 102 169 88 165 62 Polygon -7500403 true true 149 66 142 78 139 96 141 111 146 139 148 147 110 147 113 131 118 106 126 71 box true 0 Rectangle -7500403 true true 46 47 255 255 butterfly1 true 0 Polygon -16777216 true false 151 76 138 91 138 284 150 296 162 286 162 91 Polygon -7500403 true true 164 106 184 79 205 61 236 48 259 53 279 86 287 119 289 158 278 177 256 182 164 181 Polygon -7500403 true true 136 110 119 82 110 71 85 61 59 48 36 56 17 88 6 115 2 147 15 178 134 178 Polygon -7500403 true true 46 181 28 227 50 255 77 273 112 283 135 274 135 180 Polygon -7500403 true true 165 185 254 184 272 224 255 251 236 267 191 283 164 276 Line -7500403 true 167 47 159 82 Line -7500403 true 136 47 145 81 Circle -7500403 true true 165 45 8 Circle -7500403 true true 134 45 6 Circle -7500403 true true 133 44 7 Circle -7500403 true true 133 43 8 circle false 0 Circle -7500403 true true 34 34 230 opportunity true 0 Rectangle -955883 true false 46 47 255 255 participant true 0 Circle -1184463 true false 125 5 63 Rectangle -1184463 true false 120 90 195 225 Polygon -1184463 true false 120 90 30 150 45 180 113 139 120 140 Polygon -1184463 true false 195 90 285 150 270 180 185 137 Polygon -1184463 true false 120 225 100 309 138 309 150 195 Polygon -1184463 true false 165 195 180 308 212 308 180 180 Rectangle -1184463 true false 150 30 165 120 person false 0 Circle -7500403 true true 155 20 63 Rectangle -7500403 true true 158 79 217 164 Polygon -7500403 true true 158 81 110 129 131 143 158 109 165 110 Polygon -7500403 true true 216 83 267 123 248 143 215 107 Polygon -7500403 true true 167 163 145 234 183 234 183 163 Polygon -7500403 true true 195 163 195 233 227 233 206 159 problem true 0 Polygon -8630108 true false 149 1 31 239 271 239 solution true 0 Circle -2674135 true false 75 73 151 Circle -2674135 true false 11 12 273 spacecraft true 0 Polygon -7500403 true true 150 0 180 135 255 255 225 240 150 180 75 240 45 255 120 135 thin-arrow true 0 Polygon -7500403 true true 150 0 0 150 120 150 120 293 180 293 180 150 300 150 truck-down false 0 Polygon -7500403 true true 225 30 225 270 120 270 105 210 60 180 45 30 105 60 105 30 Polygon -8630108 true false 195 75 195 120 240 120 240 75 Polygon -8630108 true false 195 225 195 180 240 180 240 225 truck-left false 0 Polygon -7500403 true true 120 135 225 135 225 210 75 210 75 165 105 165 Polygon -8630108 true false 90 210 105 225 120 210 Polygon -8630108 true false 180 210 195 225 210 210 truck-right false 0 Polygon -7500403 true true 180 135 75 135 75 210 225 210 225 165 195 165 Polygon -8630108 true false 210 210 195 225 180 210 Polygon -8630108 true false 120 210 105 225 90 210 turtle true 0 Polygon -7500403 true true 138 75 162 75 165 105 225 105 225 142 195 135 195 187 225 195 225 225 195 217 195 202 105 202 105 217 75 225 75 195 105 187 105 135 75 142 75 105 135 105 wolf-left false 3 Polygon -6459832 true true 117 97 91 74 66 74 60 85 36 85 38 92 44 97 62 97 81 117 84 134 92 147 109 152 136 144 174 144 174 103 143 103 134 97 Polygon -6459832 true true 87 80 79 55 76 79 Polygon -6459832 true true 81 75 70 58 73 82 Polygon -6459832 true true 99 131 76 152 76 163 96 182 104 182 109 173 102 167 99 173 87 159 104 140 Polygon -6459832 true true 107 138 107 186 98 190 99 196 112 196 115 190 Polygon -6459832 true true 116 140 114 189 105 137 Rectangle -6459832 true true 109 150 114 192 Rectangle -6459832 true true 111 143 116 191 Polygon -6459832 true true 168 106 184 98 205 98 218 115 218 137 186 164 196 176 195 194 178 195 178 183 188 183 169 164 173 144 Polygon -6459832 true true 207 140 200 163 206 175 207 192 193 189 192 177 198 176 185 150 Polygon -6459832 true true 214 134 203 168 192 148 Polygon -6459832 true true 204 151 203 176 193 148 Polygon -6459832 true true 207 103 221 98 236 101 243 115 243 128 256 142 239 143 233 133 225 115 214 114 wolf-right false 3 Polygon -6459832 true true 170 127 200 93 231 93 237 103 262 103 261 113 253 119 231 119 215 143 213 160 208 173 189 187 169 190 154 190 126 180 106 171 72 171 73 126 122 126 144 123 159 123 Polygon -6459832 true true 201 99 214 69 215 99 Polygon -6459832 true true 207 98 223 71 220 101 Polygon -6459832 true true 184 172 189 234 203 238 203 246 187 247 180 239 171 180 Polygon -6459832 true true 197 174 204 220 218 224 219 234 201 232 195 225 179 179 Polygon -6459832 true true 78 167 95 187 95 208 79 220 92 234 98 235 100 249 81 246 76 241 61 212 65 195 52 170 45 150 44 128 55 121 69 121 81 135 Polygon -6459832 true true 48 143 58 141 Polygon -6459832 true true 46 136 68 137 Polygon -6459832 true true 45 129 35 142 37 159 53 192 47 210 62 238 80 237 Line -16777216 false 74 237 59 213 Line -16777216 false 59 213 59 212 Line -16777216 false 58 211 67 192 Polygon -6459832 true true 38 138 66 149 Polygon -6459832 true true 46 128 33 120 21 118 11 123 3 138 5 160 13 178 9 192 0 199 20 196 25 179 24 161 25 148 45 140 Polygon -6459832 true true 67 122 96 126 63 144 @#$#@#$#@ NetLogo 4.0.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@