1 / 27

Top-Down and Bottom-Up Scheduling in Swarm

Top-Down and Bottom-Up Scheduling in Swarm. A comparison of implementations Paul E. Johnson University of Kansas. Overview. Agent-Based Modeling and the “bottom-up” objective Top-down scheduling Bottom-up scheduling strategies Verification. ABM and bottom-up modeling.

alvis
Télécharger la présentation

Top-Down and Bottom-Up Scheduling in Swarm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Top-Down and Bottom-Up Scheduling in Swarm A comparison of implementations Paul E. Johnson University of Kansas

  2. Overview • Agent-Based Modeling and the “bottom-up” objective • Top-down scheduling • Bottom-up scheduling strategies • Verification

  3. ABM and bottom-up modeling • Autonomous individuals • Limited information • Experiential learning • Polymorphic modeling

  4. But Scheduling is still Top-Down • Standard cellular automaton. • “Freeze” a snapshot of the grid • Update cells against snapshot • Flush all updated cells onto grid • Repeat

  5. Examine Many Swarm Apps • Agent design/philosophy is bottom-up • Scheduling is top-down • 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

  6. Heatbugs • Traditional Swarm-1.0 approach • createActionForEach actionForEach = [modelActions createActionForEach: heatbugList message: M(step)]; • Swarm-1.0.5 introduced “randomized” traversal of the list by allowing [actionForEach setDefaultOrder: Randomized];

  7. Heatbugs-2.1 • FAction framework • Create a “call” object and then have each agent respond to that call. id call = [Fcall create ….]; actionForEach = [modelActions createFActionForEachHomogeneous: heatbugList call: call];

  8. Bottom-up Scheduling • 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:

  9. Harmonize actions across levels

  10. 2 Approaches for B-U Scheduling • Master Schedule • Decentralized Autonomous Schedules

  11. Master B-U Scheduling • Create one Schedule object in ModelSwarm level • In each agent, at create time, tell agent about Schedule. - setSchedule: id <Schedule> aSched; • Agent’s step method: • Carry out actions for “current time” and • Place “step” method on schedule for future time.

  12. Master Schedule in Mousetrap • Mousetrap “dynamic schedule” is an intermediate example • One Schedule created in Model Swarm • 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 [modelSchedule at: n createActionTo: trap message: M(trigger)];

  13. Complication: Concurrency • 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

  14. Concurrent Randomization id groupProto = [ConcurrentGroup customizeBegin: self]; [groupProto setDefaultOrder: Randomized]; groupProto = [groupProto customizeEnd]; agentSchedule = [Schedule createBegin: self]; [agentSchedule setConcurrentGroupType: groupProto]; [agentSchedule setAutoDrop: YES]; agentSchedule = [agentSchedule createEnd];

  15. Decentralized B-U Scheduling • 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.

  16. activateIn: 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

  17. How Does Swarm Do it? • 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”

  18. Randomization Customization • (post Swarm-2.1.1) • pjrepeater*.m • Step 1/5: create AgentSwarm (a container) • Step 2/5: customize ConcurrentGroup (same as previous groupProto)

  19. Customize “container swarm” • Step 3/5: customize a Schedule object syncSched = [Schedule customizeBegin: self]; [syncSched setConcurrentGroupType: groupProto]; [syncSched setAutoDrop: 1]; syncSched = [syncScheduleProto customizeEnd];

  20. Set Sync Type! • Step 4/5: customize the “container Swarm” with Schedule agentSwarm = [AgentSwarm createBegin: self]; [agentSwarm setSynchronizationType: syncSched]; agentSwarm = [agentSwarm createEnd];

  21. Put agents into context • Step 5/5: Activate citizens inside context of container (AgentSwarm). [citizenList forEach: M(activateIn:):self];

  22. How do we know it works? • Take a complicated model • Design it to compare both implementations • Compare results!

  23. My Monster Opinion Project • Agents move, interact, adjust in here:

  24. Time passes in days • 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)

  25. Conclusions • Either implementation is fine! • Master Schedule simpler to implement • Decentralized Scheduling slower!

More Related