Multiagent Simulation and the MASON Library

Multiagent Simulation and the MASON Library

Multiagent Simulation And the MASON Library Sean Luke Department of Computer Science George Mason University Manual Version 20 August, 2019 Where to Obtain MASON http://cs.gmu.edu/∼eclab/projects/mason/ Copyright 2010–2019 by Sean Luke. Thanks to Claudio Cioffi Revilla and Carlotta Domeniconi. Get the latest version of this document or suggest improvements here: http://cs.gmu.edu/∼eclab/projects/mason/ This document is licensed under the Creative Commons Attribution-No Derivative Works 3.0 United States License, except for those portions of the work licensed differently as described in the next section. To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. A quick license summary: • You are free to redistribute this document. • You may not modify, transform, translate, or build upon the document except for personal use. • You must maintain the author’s attribution with the document at all times. • You may not use the attribution to imply that the author endorses you or your document use. This summary is just informational: if there is any conflict in interpretation between the summary and the actual license, the actual license always takes precedence. This document is was produced in part through funding from grants 0916870, 1205626, and 1317813 from the National Science Foundation. 0 Contents 1 Introduction 7 1.1 Architectural Layout . .9 1.2 Unpacking MASON . 10 1.3 Running MASON . 11 1.4 Additional MASON Modules . 11 2 Tutorial: Student Schoolyard Cliques 13 2.1 Create an Empty Simulation . 13 2.2 Add Some Students . 15 2.3 Make the Students Do Something . 16 2.4 Add a GUI Control . 19 2.5 Add Visualization . 21 2.6 Add a Social Network . 25 2.7 Visualize the Social Network . 28 2.8 Inspect Student Agitation and Customize its Visualizaion . 30 2.9 Inspect the Model . 35 2.10 Select, Label, and Move Students . 39 2.11 Add an Anonymous Agent . 43 2.12 Checkpoint the Simulation . 47 2.13 Add a Description . 48 2.14 Go 3D . 51 3 Basic Utility Classes 57 3.1 Random Number Generation . 57 3.1.1 Distributions with COLT . 59 3.1.2 Distributions with Apache Commons Math . 61 3.2 Coordinate Wrapper Classes . 61 3.3 Collections . 69 3.4 Properties . 74 3.4.1 Java Bean Property Methods and Extensions . 74 3.4.2 MASON Extensions . 75 3.4.3 Object Properties . 77 3.4.4 Collection Properties . 80 3.4.5 Dynamic Properties . 80 3.5 Other Classes . 81 4 The Simulation Core 85 4.1 The Model . 85 4.2 The Big Loop . 87 4.2.1 Checkpointing . 89 1 4.2.1.1 Debugging Checkpointing . 90 4.2.2 The doLoop() Method . 90 4.2.3 Starting and Finishing . 92 4.3 Agents and the Schedule . 93 4.3.1 Scheduling . 93 4.3.2 Iterating and Stopping the Schedule . 97 4.3.3 Bookend Steppables . 98 4.3.4 Under the Hood . 99 4.3.5 Utility Agent Classes . 100 5 Grids 117 5.1 General Topics . 117 5.1.1 Extents . 119 5.1.2 Hexagonal and Triangular Grids . 120 5.1.3 Neighborhood Lookup . 121 5.1.4 Maps . 124 5.2 Array Grids . 125 5.2.1 Grids of Integers . 127 5.2.2 Grids of Doubles . 128 5.2.3 Grids of Objects . 129 5.2.4 Grids of Bags of Objects . 129 5.3 Sparse Fields and Sparse Grids . 132 5.3.1 Sparse Fields . 132 5.3.1.1 Tuning . 134 5.3.1.2 Under the Hood . 134 5.3.2 Sparse Grids . 135 5.3.2.1 Sparse Grids Versus Object Grids Versus Dense Grids . 136 6 Continuous Space 139 6.1 Extents . 141 6.2 Storing, Moving, Looking Up, and Removing Objects . 143 6.3 Discretization . 144 6.3.1 Objects with Area or Volume . 145 6.3.2 Discretization Methods . 145 6.4 Neighborhood Lookup . 146 6.5 Maps . 147 7 Networks 149 7.1 Edges . 150 7.2 Using a Network . 151 7.2.1 Adjacency Lists and Adjacency Matrices . 153 7.2.2 Maps . 153 8 Making a GUI 155 8.1 Encapsulation of the Model, Control, and Visualization . 156 8.1.1 Running a GUI-based Simulation . 158 8.1.2 Properly Scheduling non-Model (GUI) Events . 159 8.1.3 Calling GUI Elements From the Schedule/Mini-Schedule Thread (and Vice Versa) . 160 8.1.4 Handling Checkpoints . 163 8.2 Controllers . 164 8.2.1 The Controller’s Big Loop . 164 8.2.2 The Console . 165 2 8.2.2.1 Setting up and Shutting Down the GUI . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    374 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us