TopDown and BottomUp Scheduling in Swarm A comparison
Top-Down and Bottom-Up Scheduling in Swarm A comparison of implementations Paul E. Johnson University of Kansas
Overview n n Agent-Based Modeling and the “bottomup” objective Top-down scheduling Bottom-up scheduling strategies Verification
ABM and bottom-up modeling n n Autonomous individuals Limited information Experiential learning Polymorphic modeling
But Scheduling is still Top. Down n Standard cellular automaton. n n “Freeze” a snapshot of the grid Update cells against snapshot Flush all updated cells onto grid Repeat
Examine Many Swarm Apps n n Agent design/philosophy is bottom-up Scheduling is top-down n Agents are kept in a list They “step” (do something”) when told to do so. Agents have no notion of “time” although they are aware of things changing
Heatbugs n Traditional Swarm-1. 0 approach create. Action. For. Each action. For. Each = [model. Actions create. Action. For. Each: heatbug. List message: M(step)]; n Swarm-1. 0. 5 introduced “randomized” traversal of the list by allowing [action. For. Each set. Default. Order: Randomized]; n
Heatbugs-2. 1 FAction framework n Create a “call” object and then have each agent respond to that call. id call = [Fcall create …. ]; action. For. Each = [model. Actions create. FAction. For. Each. Homogeneous: heatbug. List call: call]; n
Bottom-up Scheduling n n n Ideal world: agents “decide for themselves” when to act Discrete Sim Libraries must integrate these many disparate behaviors so that they “fall into a common time line” Time is a conveyor belt:
Harmonize actions across levels
2 Approaches for B-U Scheduling n n Master Schedule Decentralized Autonomous Schedules
Master B-U Scheduling n n n Create one Schedule object in Model. Swarm level In each agent, at create time, tell agent about Schedule. - set. Schedule: id <Schedule> a. Sched; Agent’s step method: n n Carry out actions for “current time” and Place “step” method on schedule for future time.
Master Schedule in Mousetrap “dynamic schedule” is an intermediate example One Schedule created in Model Swarm n Agent’s (mouse traps) are not aware of Schedule, but instead they “trigger” and tell Model to trigger some other trap at some future time [model. Schedule at: n create. Action. To: trap message: M(trigger)]; n
Complication: Concurrency n n n What if several agents “schedule themselves” at a given time? Ordinarily, actions in Swarm schedules are ‘first come, first serve’ Possible to randomize actions when a cell is reached: Concurrent Group Options
Concurrent Randomization id group. Proto = [Concurrent. Group customize. Begin: self]; [group. Proto set. Default. Order: Randomized]; group. Proto = [group. Proto customize. End]; agent. Schedule = [Schedule create. Begin: self]; [agent. Schedule set. Concurrent. Group. Type: group. Proto]; [agent. Schedule set. Auto. Drop: YES]; agent. Schedule = [agent. Schedule create. End];
Decentralized B-U Scheduling n n Each agent is a Swarm with a Schedule Activate each within “agent swarm” Agent tells self to “step” at future a future time point by putting action on its own schedule. Swarm able to integrate actions across all agents.
activate. In: is magic When a schedule is activated in a Swarm, each time step (t): “clears” all the actions on that cell at t And It traverses all time t cells in all Swarms that are activated in it
How Does Swarm Do it? n n n Synchronization is the key word At each time step, each Swarm “scans” all lower Swarms to see if they have actions to be executed. Default: “first on, first off”
Randomization Customization n n (post Swarm-2. 1. 1) pjrepeater*. m Step 1/5: create Agent. Swarm (a container) Step 2/5: customize Concurrent. Group (same as previous group. Proto)
Customize “container swarm” n Step 3/5: customize a Schedule object sync. Sched = [Schedule customize. Begin: self]; [sync. Sched set. Concurrent. Group. Type: group. Proto]; [sync. Sched set. Auto. Drop: 1]; sync. Sched = [sync. Schedule. Proto customize. End];
Set Sync Type! n Step 4/5: customize the “container Swarm” with Schedule agent. Swarm = [Agent. Swarm create. Begin: self]; [agent. Swarm set. Synchronization. Type: sync. Sched]; agent. Swarm = [agent. Swarm create. End];
Put agents into context n Step 5/5: Activate citizens inside context of container (Agent. Swarm). [citizen. List for. Each: M(activate. In: ): self];
How do we know it works? n n n Take a complicated model Design it to compare both implementations Compare results!
My Monster Opinion Project n Agents move, interact, adjust in here:
Time passes in days n n n Each day has 10 timesteps Agents can go and come back Randomly decide to interact. “Catch-as-catch-can” interactions Compare Master Schedule versus Fully Decentralized Scheduling 500 runs for each type (same seeds)
Conclusions n n n Either implementation is fine! Master Schedule simpler to implement Decentralized Scheduling slower!
- Slides: 27