{"data":{"markdownRemark":{"html":"<h2 id=\"introduction\"><a href=\"#introduction\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>This exercise is designed to help you define, design, and implement your own model in the Simudyne SDK. Whether you are\nnew to the agent-based modelling field, or a seasoned veteran, it is recommended that new users start here when building\nthe first of their own models in order to build a strong foundation in the core concepts and functionalities of the\ntechnology.</p>\n<p>If you have never built a model in the Simudyne SDK before, please read the below sections before beginning this\nexercise:</p>\n<ol>\n<li><a href=\":version/overview/welcome\">About Simudyne SDK</a></li>\n<li><a href=\":version/features/graph-computation\">Graph Computation Approach</a></li>\n</ol>\n<p>It is also recommended that new users begin with some tutorials, sample models, and challenges before attempting this\nexercise:</p>\n<ol>\n<li><a href=\":version/tutorials\">Tutorials</a></li>\n<li><a href=\":version/tutorials\">Sample Models</a></li>\n<li><a href=\":version/challenges\">Challenges</a></li>\n</ol>\n<p><strong>Estimated time to complete:</strong> ~1 day</p>\n<p><strong>Sections &#x26; topics covered:</strong></p>\n<ol>\n<li>Iterative Model Building</li>\n<li>Repeatable Models</li>\n<li>Use Case Definition</li>\n<li>Model Design &#x26; Class Organisation</li>\n<li>Implementation</li>\n<li>Interactive Console Mode</li>\n<li>Headless (BackendRunner) Mode</li>\n<li>Input &#x26; Output</li>\n<li>Analyzing Results with Jupyter or another data science tool</li>\n</ol>\n<p>The objective of this exercise is to select a system of interest and build the first iteration of an agent-based model\nin the Simudyne SDK.</p>\n<p>At the end of this exercise you will have a simulation and data science workflow that includes the following:</p>\n<ol>\n<li>VCS: GitHub repo</li>\n<li>Agent-based model</li>\n<li>Interactive console model runner</li>\n<li>Headless model runner</li>\n<li>Input data channels</li>\n<li>Output data channels</li>\n<li>Advanced analytics capabilities (Jupyter Notebook)</li>\n</ol>\n<p>If you'd like to get a trial license to the Simudyne SDK, you can follow the link below to get access.</p>\n<p><a href=\"https://aws.amazon.com/marketplace/search/results?prevFilters=%7B%22id%22%3A%22seller-2hr6jozikusxs%22%2C%22ref%22%3A%22dtl_prodview-g5gyonn4zmvdo%22%7D&searchTerms=simudyne+free\" class=\"ui button primary\" download>Simudyne SDK Free Trial</a></p>\n<div class=\"ui segment info message\">\n<p>If this is the first time you are building an agent-based model of any kind, we recommend starting\nwith <a href=\":version/overview/abm\">What is ABM?</a>, <a href=\":version/tutorials\">Tutorials</a>, and <a href=\":version/challenges\">Challenges</a> which\nprovide you with an example use case and guide your through implementation. It will be easier to grasp the core concepts\nof the paradigm with provided examples.</p>\n<p>Otherwise, If you have experience building agent-based systems or already have a model / system in mind that you would\nlike to simulate, this will be the best place to start.</p>\n</div>\n<p>Each section builds upon the previous and should be followed in order.</p>\n<h2 id=\"iterative-model-building\"><a href=\"#iterative-model-building\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Iterative Model Building</h2>\n<p>Iterative and incremental development practices are key to Agile software development. The goal is to break down the\ndevelopment of a large application into smaller chunks. Code is designed, developed and tested in cycles. Each iteration\nsees the addition of new features to enhance the overall functionality of the application. At each stage of development,\nthe user should have a functional application.</p>\n<p>Building agent-based models has a number of parallels to developing software. Building these types of models calls for\nthe adoption of a software developer's mindset.</p>\n<p>Rather than trying to build a large and complex model in one attempt, modellers should ensure that sensible model output\ncan be obtained at all stages of model development. Doing so requires the modeller to start by implementing a stripped\ndown version of the desired model. Model complexity is layered on incrementally, ensuring that each iteration of the\nmodel produces sensible output.</p>\n<p>This type of workflow is supported by Git version control. Each incremental increase in model complexity, such as the\nintroduction of a new agent type or the addition of a new method to an agent's behaviour, should be tested thoroughly.\nOnce the modeller is satisfied, the new version of the model can be committed to version history. Changes which break\nthe model's functionality can simply be rolled-back.</p>\n<p>Branches support experimental model development. Modellers can create multiple branches from a model's master branch,\ntesting new concepts and functionalities in each one. When a modeller is satisfied with functionality in a branch, they\ncan merge that branch with the model's master branch.</p>\n<p>We've provided a starter project that includes a shell model for ease of getting started and setting up VCS before you\nstart building.</p>\n<a href=\"https://simudynecontent.blob.core.windows.net/$web/2.5.0/my_first_model_2.5.0.zip\" class=\"ui button primary\" download>\nDownload Starter Project</a>\n<div class=\"ui segment warning message\" ><h4>Set up a VCS</h4>\n<p>It is not required, but it is recommended that you set up a GitHub repo or another VCS for maintaining this project before moving on to the next section.\n</p></div>\n<h2 id=\"repeatable-models\"><a href=\"#repeatable-models\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repeatable Models</h2>\n<p>An important part of building models is that their results should be repeatable if the same inputs are given to them.\nThe Simudyne SDK creates models that rely on numerical seeds that are randomly generated. A number of tools are provided\nfor random number generation, but if a model is built properly, it should still be deterministic with respect to its\nseed.</p>\n<p>It is easy to unintentionally introduce other sources of randomness into the model besides its numerical seed. The\noutput of a properly built model should only change under two conditions: if its input parameters change or if its\nnumerical seed is purposely changed. For the same model running with the same seed, the only source of change should be\nthe input parameters.</p>\n<p>To learn more about how to ensure determinism in your model, check\nout <a href=\":version/reference/modelling/determinism\">Determinism</a></p>\n<h2 id=\"use-case-definition\"><a href=\"#use-case-definition\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Use Case Definition</h2>\n<p>If you are looking to identify a use case or want to assess the suitability of one you have selected to the agent-based\napproach, check out <a href=\":version/overview/abm\">What is ABM?</a></p>\n<p>If you already have a model that you want to implement and have defined specifications for that model, you can skip to\nthe next section.</p>\n<p>Once you have identified the system you wish to model, the next objective is to design a simplified version that begins\nto reproduce the dynamics of your real-world system.</p>\n<p><strong>Components to identify:</strong></p>\n<ol>\n<li>Emergent / Reactive Properties</li>\n<li>Agent Types</li>\n<li>Agent Behaviors &#x26; Interactions</li>\n<li>Environment</li>\n</ol>\n<p>Let's start with an example and look at how we approach simulating an equity market. The example being used in this\nsection is the <a href=\":version/tutorials/trader\">Synthetic Market Tutorial</a>.</p>\n<p>An equity market is made up of an exchange and market participants. We can visualize the structure of a market as below:</p>\n<p>\n  <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block; padding: 20px; max-width: 407px; margin-left: auto; margin-right: auto;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 139.3120393120393%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAcCAYAAABh2p9gAAAACXBIWXMAABYlAAAWJQFJUiTwAAAEy0lEQVRIx62VW2xVRRSGj4kxEZ+MiqKBgIhcfNB4STQoV4EHH7xEQyAiFw0FxHATELkGgRBNxKhoQrwgRhNAAyIoodYgCKhQKVBawNKWntLTUtrTc+k5s2/zuWb27mkpwfDgTiYz5+w9//zrn3+tFQNN+OhuA+riTZw7F6e6uoF/quq5cKHRrmtrG2UkqI1+V1VdJJlM2z0x34dkStOWNrMMmVvbNJl2qDhzmdLj9RwtrePPo3WcLE9wqqKJ8spLnDiVoEzG8ZMN8j5OXX2WIBBAz9MWKGQVdBvX/+Ty0J7TxBwXfF+zdbei6G3F0vcclrzryNphV7GywEEQyhAEPko5OI6D67pooaR1+C6vtAWN5c0e2fTaW4rY3dBvOPR9Sl70gckLFKlMICeHDFqSDqcrG0XPy5RXNNKazBf0DxnKPjnQAs5/x+HmITB4rGbIOE2PB2DuakUmG1h929JatIVEk8vFhCKbC6zerkhmWBpiOWFZYLhgrUOsH4ydAiMmYterNjj2nZFFR2bItSdpbWkmnfG7adgt5OlL8hKyLyH79B3mE+vl8+bavA3HgCkVsH1Pns3fuXy21RWdFR9vUXzytaL4oMLzoksRbVGO5thJl292OnI5Dtv2OHZddtoteDJxyWPgKMUjz2oeeiZgxISAoS8FVqLh48ODs+2RbVKZa9vBD0LA5hafASNd7ngUej0O9zwB94+G2x6GMS8rC5jJRoDp7LUBgwiwocln5ASHaYsQR2imLAzHc0UwfnYImDW37EQhH/jL4aPNii+3Kb6Q8aGsj5Q6hZBr631mLXf48Vc4XaWJJ6DyvKaiCl5fbjTUtHe9lBlLxYe9NQOf1tw3UsTto1m4ThUypjbuCzPRdy9s2qb55YiQOKb5oQRmLVPWPlf4cO7q0IcDRiGg0EPWi9eHgIbN4dKQ4Y598Pl2za4Sya6fNF/tuAZD68O+IvBkzbAJmhv6YxnWxAPrr/KzPtMlHf+uhENlmuLDmi07NZu/F8AVXRh2AJo8jt0Fg8YIS7m92J2ID7uEXB+GvO8QbP1Zc7BUc+SEZvd+mLksYthxKQZ9d4li1QeKdRsV6z9VrNyg2HdAXXEpM5Y67D2IhKkpO6OpaRDQss6QbaZc6cOri6zfxTbjXnGZvUoAVmrmrNYsWq+ZthgmzlE2nyNjIz7U12Fsj1sfdKwUvZ/U1tg9HxOAW2Doi6ozU0zqmduprvPY/4fLoWMev8v4TdY1ca/ANCXF4I0VOSbNU0yarxg3WdnyZky9bmPO5nu2vUu1KVqSEx+6DB7jinVc8aHHgjU5C+j7VzNvbpVdulMao5+pOAUfzpN6eNNAuHd46EWzXvl+WL7MN0Zrk1EX4knOVzdL2/Cs9p31sFv5mr/G4cYBMHpS6EMDOFNuLyUF9rIU1hZpXC3SexqbPS42OWFjyxC1gKin5Lv78HbNIClH/UcJ9Z4wdaHC8UKGrmeqtkPl2QTna5o5c66RZFtnC7AVOx+lnqkom77N88IMxdRFilcXK54vUlITOwtsx0ZPkD2xRkeTugrQaNOW/o966IdhmUONg+w1RAeYuaO8mSyxmWJ+mwZkNGlJatvkzWw0M/+lMqHxzaHhWtvv09GcSoc+Ng3MHB7jf37+BZBhuKeLlHdSAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n    >\n      <picture>\n        <source\n          srcset=\"/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-e2c87.webp 173w,\n/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-ed890.webp 345w,\n/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-df66b.webp 690w,\n/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-af7d8.webp 814w\"\n          sizes=\"(max-width: 407px) 100vw, 407px\"\n          type=\"image/webp\"\n        />\n        <source\n          srcset=\"/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-aae45.png 173w,\n/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-fd247.png 345w,\n/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-429e2.png 690w,\n/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-e26bf.png 814w\"\n          sizes=\"(max-width: 407px) 100vw, 407px\"\n          type=\"image/png\"\n        />\n        <img\n          class=\"gatsby-resp-image-image\"\n          style=\"width: 100%; height: 100%; margin: 0; vertical-align: middle; position: absolute; top: 0; left: 0; box-shadow: inset 0px 0px 0px 400px white;\"\n          src=\"/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-429e2.png\"\n          alt=\"equity diagram\"\n          title=\"\"\n          src=\"/static/equity_diagram-c7bd3a9d2cd87c917c8336bc63067884-429e2.png\"\n        />\n      </picture>\n      </span>\n  </span>\n  </p>\n<p>The market is made up of the different types of traders that can represent anything from individuals / retail traders,\nto the tier 1 banks and large hedge funds.</p>\n<p>Additionally, the exchange has a complex set of protocols as well as an order book and matching engine.</p>\n<p>Let's identify and simplify each component from the list above and use the equity market example for each one.</p>\n<h3 id=\"1-emergent--reactive-properties\"><a href=\"#1-emergent--reactive-properties\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Emergent / Reactive Properties</h3>\n<p>Emergent properties and phenomena arise when micro-level interactions produce a macro-level effect. In the case of the\nequity market, the price formation process is an emergent property generated by the varied buying and selling strategies of the market participants and the market mechanism.</p>\n<p>A key advantage of an agent-based simulation is the ability to capture the non-linear dynamics of a complex adaptive system.\nUnderstanding how the micro leads to the macro can provide powerful insights into how one might optimise for or against\na particular macro outcome.</p>\n<p>Using the equity market example, emergent properties include: price, volatility, fire sales, etc. Let's say we select\nprice as the feature to reproduce first.</p>\n<p>The price is dictated by the buying and selling of the shares. Thus, we will need to simulate the buying and selling of\nshares by our virtual traders to generate a simple price formation process.</p>\n<p><strong>Components to Identify (Equity Market Example):</strong></p>\n<ol>\n<li><strong>Emergent / Reactive Properties = Price</strong></li>\n<li><em>Agent Types</em></li>\n<li><em>Agent Behaviors &#x26; Interactions</em></li>\n<li><em>Environment</em></li>\n</ol>\n<div class=\"ui segment warning message\" ><h4>Emergent / Reactive Properties</h4>\n<p>Identify the emergent properties of your system and select a single emergent phenomena to simulate.</p></div>\n<h3 id=\"2-agent-types\"><a href=\"#2-agent-types\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Agent Types</h3>\n<p>Now that a desired emergent / reactive property has been selected we want to identify the types of agents involved in\nthe system and that contribute to the process.</p>\n<p>Agent types should be defined based on their unique relationships and capabilities for interaction.</p>\n<p>For simplification purposes, we want to create the most undifferentiated version of our agent types. In the equity\nmarket example, the markets consist of an ecosystem of traders deploying different strategies at global exchanges. The simplified model needs just 1 basic trader type and 1 simple exchange.</p>\n<p>We could represent fundamental traders, momentum traders, market makers, etc. in our model. However, the first step will\nbe creating a basic trader type agent that sends simple orders to an exchange. The complexity of the trader and the\norder will be layered in after the mechanics of the market have been defined.</p>\n<p><strong>Components to identify (Equity Market Example):</strong></p>\n<ol>\n<li><strong>Emergent / Reactive Properties = Price</strong></li>\n<li><strong>Agent Types = Trader + Exchange</strong></li>\n<li><em>Agent Behaviors &#x26; Interactions</em></li>\n<li><em>Environment</em></li>\n</ol>\n<div class=\"ui segment warning message\" ><h4>Agent Types</h4>\n<p>Identify the basic agent type or types that will be necessary for your simulation. Focus on selecting the simplest abstraction of each participant in the system.</p></div>\n<h3 id=\"3-agent-behaviors--interactions\"><a href=\"#3-agent-behaviors--interactions\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Agent Behaviors &#x26; Interactions</h3>\n<p>Agents are capable of reacting to their environment and interacting with other agents in the system. An agent-based simulation may consist of numerous complex sets of interactions and behaviors. The simplest form of\ninteraction should be captured first. This interaction should be driven by 1-2 variables.</p>\n<p>In the equity market example, the trader agents and exchange agents both have behaviors:</p>\n<p><strong>Trader Behaviors:</strong> decide when to buy / sell, send buy order, send sell order, receive market\ninformation\n<strong>Exchange Behaviors:</strong> receive orders from traders, match orders / calculate price.</p>\n<p>Notice that these behaviors are simple, and their logic will also be very simple in the beginning. More on the specifics\nof the equity market example can be found in the <a href=\"https://docs.simudyne.com/tutorials/trader#behaviours\">Behaviors Section</a> of the Synthetic Market Tutorial.</p>\n<p><strong>Components to identify (Equity Market Example):</strong></p>\n<ol>\n<li><strong>Emergent / Reactive Properties = Price</strong></li>\n<li><strong>Agent Types = Trader + Exchange</strong></li>\n<li><strong>Agent Behaviors &#x26; Interactions = Traders Trade + Exchange Calculate Price + Exchange Publish Price</strong></li>\n<li><em>Environment</em></li>\n</ol>\n<div class=\"ui segment warning message\" ><h4>Agent Behaviors & Interactions</h4>\n<p>Identify the minimum set of behaviors required to reproduce the mechanics of your system. The aim is to minimize the amount of interactions and components needed to capture the dynamics.</p></div>\n<h3 id=\"4-environment---physical-social-economical-etc\"><a href=\"#4-environment---physical-social-economical-etc\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>4. Environment - physical, social, economical, etc</h3>\n<p>Agents are programmed to interact with their environment and with other agents. The environment may be a spatial location\nof an agent relative to other agents, or it may provide a set of dynamically determined features, like the price of an\nequity or changes in interest rates.</p>\n<p>In the equity market example, the price of the equity, the policies at the exchange, the liquidity, real-world events,\netc. are all elements of the environment.</p>\n<p>To simplify the equity market environment, the price at the exchange will represent our main environment variable as this will be the minimum requirement to drive the trader behaviors.</p>\n<p><strong>Components to identify (Equity Market Example):</strong></p>\n<ol>\n<li><strong>Emergent / Reactive Properties = Price Formation Process</strong></li>\n<li><strong>Agent Types = Trader + Exchange</strong></li>\n<li><strong>Agent Behaviors &#x26; Interactions = Traders Trade + Exchange Calculate Price + Exchange Publish Price</strong></li>\n<li><strong>Environment = Price at the Exchange</strong></li>\n</ol>\n<p>If your environment contains spatial elements, the below models may provide code or insight into how to account for\nspace. (The Simudyne SDK does not contain an explicit set of features for simulating 2D space):</p>\n<ol>\n<li><a href=\":version/models/tumor\">Tumor Growth Model</a></li>\n<li><a href=\":version/tutorials/forestfire\">Forest Fire Tutorial</a></li>\n<li><a href=\":version/tutorials/schelling\">Schelling Tutorial</a></li>\n</ol>\n<div class=\"ui segment warning message\" ><h4>Environment</h4>\n<p>Identify the main environment variable that will influence the interactions of your system. Focus on identifying the feature of your environment that will drive agent behaviors</p></div>\n<p>Once you have completed identifying the 4 key components of your system, you are ready to design the implementation of\nyour model.</p>\n<h2 id=\"model-design--class-organization\"><a href=\"#model-design--class-organization\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Model Design &#x26; Class Organization</h2>\n<p>Now that you have defined the basic components of your model, the objective of this section is to design\nthe structure of your code following some best practices in the Simudyne SDK before you begin your implementation.</p>\n<p>Only some best practices are mentioned in this section, more information that may be relevant to your model can be found\nin the <a href=\":version/reference/modelling\">Reference</a>.</p>\n<div class=\"ui segment warning message\" ><h4>Refactor Starter Project</h4>\n<p>Use the structure of the starter project provided in the Iterative Model Building section and refactor the classes to match the specifications from the previous section.\n</p></div>\n<h3 id=\"groups-of-agents\"><a href=\"#groups-of-agents\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Groups of Agents</h3>\n<p>The agents within models can be arranged in groups where each group of agents represents a larger entity, such as a pool\nof investors. These groups can be connected together by creating links between agents that span the groups. When two\ngroups are being connected together, one group is considered the \"source\", while the other is the \"target\". When two\ngroups are connected together, the usual layout of those connections is to link every agent in the source group with\nevery agent in the target group.</p>\n<p>If the number of agents in the source group is represented by <em>M</em>, and the number of agents in the target group is\nrepresented by <em>N</em>, it takes <em>M x N</em> links to connect the two groups completely. This works well for small models, where\nthere are less than one million agents in total, but the number of connections can skyrocket as the number of agents\nincreases. The large number of connections can cause major slowdowns in model execution.</p>\n<h3 id=\"actions-and-sequences\"><a href=\"#actions-and-sequences\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Actions and Sequences</h3>\n<p>Models can quickly grow to have many actions with splits in a single sequence. Adding the implementation logic for\nagents in the same place can make the sequence of actions hard to follow.</p>\n<p>Actions should be created by functions inside agents. The functions should have clear names indicating the action's\npurpose. With purposeful naming, the sequence of steps becomes a sequence of clear action names, rather than a sequence\nof code that is hard to read.</p>\n<h3 id=\"messages\"><a href=\"#messages\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Messages</h3>\n<p>Messages should be defined in a shared message class so they can be used by the entire model. Individual messages should\nbe defined as static classes inside the larger message class. Do not define messages inside agents, inside a model, or\nas many separate classes. This can lead to code duplication and difficulty in class maintenance.</p>\n<p>The Simudyne SDK provides built-in classes for messages which contain a single primitive type (integer, long, double,\nfloat, boolean) or an empty body. Modellers need only extend these built-in classes to get all the functionality they\nneed.</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Messages</span> <span class=\"token punctuation\">{</span>\n\n    <span class=\"token comment\">// Custom message classes that extend the built-in message type for doubles</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Bid</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Message<span class=\"token punctuation\">.</span>Double</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token punctuation\">}</span>\n\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Vacancy</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Message<span class=\"token punctuation\">.</span>Double</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>If a message needs to pass multiple different primitive types, but no complex objects or behaviour, extend the Simudyne\nSDK <code class=\"language-text\">Message</code> object.</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token comment\">// Message class for price quotes, which passes only primitive types.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Messages</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">PriceQuoteMessage</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Message</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">double</span> price<span class=\"token punctuation\">;</span>\n        <span class=\"token keyword\">double</span> reducedPrice<span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// Class demonstrating usage of price quote messages.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Seller</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Agent</span><span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>GlobalState<span class=\"token punctuation\">></span></span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> Action<span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>Seller<span class=\"token punctuation\">></span></span> <span class=\"token function\">sendPriceQuote</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">return</span> Action<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                Seller<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                seller <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                    seller\n                            <span class=\"token punctuation\">.</span><span class=\"token function\">getLinks</span><span class=\"token punctuation\">(</span>Links<span class=\"token punctuation\">.</span>BankLink<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">)</span>\n                            <span class=\"token punctuation\">.</span><span class=\"token function\">send</span><span class=\"token punctuation\">(</span>\n                                    Messages<span class=\"token punctuation\">.</span>PriceQuoteMessage<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                                    message <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                                        message<span class=\"token punctuation\">.</span>price <span class=\"token operator\">=</span> <span class=\"token number\">3</span><span class=\"token punctuation\">;</span>\n                                        message<span class=\"token punctuation\">.</span>reducedPrice <span class=\"token operator\">=</span> <span class=\"token number\">2.3</span><span class=\"token punctuation\">;</span>\n                                    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n                    <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>To send a complex data type, extend the Simudyne SDK <code class=\"language-text\">Message.Object&lt;T&gt;</code> generic object. Provide the name of the complex\ndata type object in place of the \"T\" variable. When an agent receives a message containing a complex data type object,\nthat agent has access to the complex data type's functions.</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token comment\">// Message class for price quotes which passes a complex data object.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Messages</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">PriceQuoteMessage</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Message<span class=\"token punctuation\">.</span>Object</span><span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>PriceQuote<span class=\"token punctuation\">></span></span> <span class=\"token punctuation\">{</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// Class demonstrating usage of complex price quote messages.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Seller</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Agent</span><span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>GlobalState<span class=\"token punctuation\">></span></span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> Action<span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>Seller<span class=\"token punctuation\">></span></span> <span class=\"token function\">sendPriceQuote</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">return</span> Action<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                Seller<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                seller <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                    seller\n                            <span class=\"token punctuation\">.</span><span class=\"token function\">getLinks</span><span class=\"token punctuation\">(</span>Links<span class=\"token punctuation\">.</span>BankLink<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">)</span>\n                            <span class=\"token punctuation\">.</span><span class=\"token function\">send</span><span class=\"token punctuation\">(</span>Messages<span class=\"token punctuation\">.</span>PriceQuoteMessage<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span> <span class=\"token keyword\">new</span> <span class=\"token class-name\">PriceQuoteMessage</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">.</span><span class=\"token punctuation\">.</span><span class=\"token punctuation\">.</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h3 id=\"agents-and-inheritance\"><a href=\"#agents-and-inheritance\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Agents And Inheritance</h3>\n<p>When multiple agent types need to share some common functionality, modellers can reduce code duplication and build\nbetter defined agents using inheritance. Extend the Simudyne SDK Agent class with the base class, and then the derived\nclasses can be implemented with their own unique functionalities. In the following example, an Accommodation agent is the\nbase for two derived agent types, Hotel and Flat. All of these agent types can be used just like other agents which\ndon't implement inheritance.</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token comment\">// Accommodation base class.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Accommodation</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Agent</span><span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>GlobalState<span class=\"token punctuation\">></span></span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">int</span> size<span class=\"token punctuation\">;</span>\n\n    <span class=\"token keyword\">public</span> Action<span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>Accommodation<span class=\"token punctuation\">></span></span> <span class=\"token function\">sendVacancyMessage</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">return</span> Action<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                Accommodation<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                accommodation <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                    <span class=\"token comment\">// Send message if vacant.</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// Flat derived class.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Flat</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Accommodation</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> Action<span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>Flat<span class=\"token punctuation\">></span></span> <span class=\"token function\">registerNewHousehold</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">return</span> Action<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                Flat<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                flat <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                    <span class=\"token comment\">// Register a new flat.</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// Hotel derived class.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Hotel</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Accommodation</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> Action<span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>Hotel<span class=\"token punctuation\">></span></span> <span class=\"token function\">registerBooking</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">return</span> Action<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                Hotel<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                hotel <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                    <span class=\"token comment\">// Make a new booking.</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// Model containing actions for Accommodation, Hotel, and Flat.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">myModel</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">AgentBasedModel</span><span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>GlobalState<span class=\"token punctuation\">></span></span> <span class=\"token punctuation\">{</span>\n    <span class=\"token annotation punctuation\">@Override</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">void</span> <span class=\"token function\">step</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token function\">run</span><span class=\"token punctuation\">(</span>\n                Accommodation<span class=\"token punctuation\">.</span><span class=\"token function\">sendVacancyMessage</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n                Household<span class=\"token punctuation\">.</span><span class=\"token function\">requestHome</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n                Split<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                        Flat<span class=\"token punctuation\">.</span><span class=\"token function\">registerNewHousehold</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n                        Hotel<span class=\"token punctuation\">.</span><span class=\"token function\">registerBooking</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n                <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>  \n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h3 id=\"external-classes\"><a href=\"#external-classes\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>External Classes</h3>\n<p>External classes should be used for functionality that is not specific to agents. This functionality may be needed by\nmultiple agents or by the model, but should not be unique to a specific agent type. A data loader or distribution\nbuilder could both be reasonable uses for these external classes. Methods in these classes should be static so that they can\nbe accessed from anywhere in a model.</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token comment\">// External distribution class.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Distribution</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> EmpiricalDistribution <span class=\"token function\">loadDistribution</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token comment\">// Load a distribution.</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token comment\">// Flat agent class which uses the distribution class.</span>\n<span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">Flat</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Agent</span><span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>GlobalState<span class=\"token punctuation\">></span></span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> Action<span class=\"token generics function\"><span class=\"token punctuation\">&lt;</span>Flat<span class=\"token punctuation\">></span></span> <span class=\"token function\">registerNewHousehold</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token keyword\">return</span> Action<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span>\n                Flat<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">,</span>\n                flat <span class=\"token operator\">-</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n                    EmpiricalDistribution distribution <span class=\"token operator\">=</span> Distribution<span class=\"token punctuation\">.</span><span class=\"token function\">loadDistribution</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Once you have a plan and design for how you wish to implement your model you are ready to move on to the next section.</p>\n<h2 id=\"implementation\"><a href=\"#implementation\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Implementation</h2>\n<p>Now that you have designed and specified the structure of your model and all its components, the objective of this\nsection is to implement the logic and compile your code.</p>\n<p>The starter project provided above can be used as a template, it contains many of the structures and best practices\nmentioned in previous sections.</p>\n<div class=\"ui segment warning message\" ><h4>Implement the Model</h4>\n<p>Using the output of the previous section, implement the model you specified and make sure you can compile your simulation and pull it up in the interactive console layer.</p></div>\n<p>If at any point you get stuck with the implementation of your model, hop into our Community Discord Server and ask a\nSimudyne Dev for help!</p>\n<a href=\"https://discord.gg/hPRQbEebG6\" class=\"ui button primary\" download>\n\tDiscord Server</a>\n<h2 id=\"interactive-console-mode\"><a href=\"#interactive-console-mode\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Interactive Console Mode</h2>\n<p>Now that you have successfully implemented your model and are able to pull it up in the console, the objective of this\nsection is to experiment with the features and develop a useful dashboard to visualise the dynamics of your\nsimulation.</p>\n<p>The below sections contain relevant information on how to design the layout of your console:</p>\n<ol>\n<li><a href=\":version/features/console\">Interactive Console</a></li>\n<li><a href=\":version/reference/data_management/outputting_data\">Outputting Data</a></li>\n</ol>\n<p>There is also a public demos site that contains live simulation demos that can be run and may inspire your layout:</p>\n<a href=\"http://demo.simudyne.com\" class=\"ui button primary\">\n\tView Demo Site\n</a>\n<div class=\"ui segment warning message\" ><h4>Design Console Layout</h4>\n<p>Using the resources above and your implemented model, expose input parameters, set up charts using @Variable annotations, and build custom accumulators to explain the output of your system.</p></div>\n<p>The console layer is a valuable feature during the conceptual phase of model building. Once the model is\nsufficiently developed, and its behavior needs to be analysed, the SDK is run and deployed in headless mode for\nperformance and scalability.</p>\n<div class=\"ui segment error message\">\nIf you are not able to see accumulator / @Variable tiles or agents in your network view make sure that you have the below configuration settings in your simudyneSDK.properties file and that they are set to true</div>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">core-abm.serialize.agents=true\ncore-abm.serialize.links=true\ncore-abm.serialize.accumulators=true</code></pre></div>\n<h2 id=\"headless-backendrunner-mode\"><a href=\"#headless-backendrunner-mode\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Headless (BackendRunner) Mode</h2>\n<p>The console is a powerful prototyping, debugging, and high-level analysis tool. It is not intended to replace the\npopular and advanced data science packages in Python, or other advanced analytics platforms and tools. The Simudyne SDK is\nalso designed to be run headless as one of the key advantages of the software is its ability to swap out different\nbackends for distributing your models using Spark or Akka.</p>\n<p>Configuring the SDK to run headless will be the first step towards getting the SDK hooked up to your Jupyter Notebook.</p>\n<p>The objective of this section is to learn how to bypass the console layer for running your experiments at speed and\nscale.</p>\n<p>Relevant sections that provide more detail on the possible configurations of this run mode can be found in the resources\nbelow:</p>\n<ol>\n<li><a href=\":version/features/run-deploy\">Run &#x26; Deploy</a></li>\n<li><a href=\":version/reference/run_deploy/multirun_setup\">Multirun Setup</a></li>\n<li><a href=\":version/features/monte_carlo\">Monte Carlo</a></li>\n</ol>\n<p>A separate Main.java class should be created to contain the headless runner code, an example has been provided below:</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">MainHeadless</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">static</span> <span class=\"token keyword\">void</span> <span class=\"token function\">main</span><span class=\"token punctuation\">(</span>String<span class=\"token punctuation\">[</span><span class=\"token punctuation\">]</span> args<span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n        <span class=\"token comment\">//Warp in try catch</span>\n        <span class=\"token keyword\">try</span> <span class=\"token punctuation\">{</span>\n            <span class=\"token comment\">//set up a ModelRunner</span>\n            RunnerBackend runnerBackend <span class=\"token operator\">=</span> RunnerBackend<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n            ModelRunner modelRunner <span class=\"token operator\">=</span> runnerBackend<span class=\"token punctuation\">.</span><span class=\"token function\">forModel</span><span class=\"token punctuation\">(</span>MyModel<span class=\"token punctuation\">.</span><span class=\"token keyword\">class</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n            <span class=\"token comment\">//Define a set of batch runs using BatchDefinitionsBuilder</span>\n            BatchDefinitionsBuilder runDefinitionBuilder <span class=\"token operator\">=</span>\n                    BatchDefinitionsBuilder<span class=\"token punctuation\">.</span><span class=\"token function\">create</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n                            <span class=\"token punctuation\">.</span><span class=\"token function\">forRuns</span><span class=\"token punctuation\">(</span><span class=\"token number\">100</span><span class=\"token punctuation\">)</span> <span class=\"token comment\">// a required field, must be greater than 0.</span>\n                            <span class=\"token punctuation\">.</span><span class=\"token function\">forTicks</span><span class=\"token punctuation\">(</span><span class=\"token number\">1000</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span> <span class=\"token comment\">// a required field, must be greater than 0.</span>\n\n            modelRunner<span class=\"token punctuation\">.</span><span class=\"token function\">forRunDefinitionBuilder</span><span class=\"token punctuation\">(</span>runDefinitionBuilder<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n            <span class=\"token comment\">// To run the model and wait for it to complete</span>\n            modelRunner<span class=\"token punctuation\">.</span><span class=\"token function\">run</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n        <span class=\"token punctuation\">}</span> <span class=\"token keyword\">catch</span> <span class=\"token punctuation\">(</span><span class=\"token class-name\">RuntimeException</span> e<span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n            System<span class=\"token punctuation\">.</span>out<span class=\"token punctuation\">.</span><span class=\"token function\">println</span><span class=\"token punctuation\">(</span>Arrays<span class=\"token punctuation\">.</span><span class=\"token function\">toString</span><span class=\"token punctuation\">(</span>e<span class=\"token punctuation\">.</span><span class=\"token function\">getStackTrace</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n            e<span class=\"token punctuation\">.</span><span class=\"token function\">printStackTrace</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n        <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>The above example uses the <code class=\"language-text\">BatchDefinitionsBuilder</code>, however there are other tools for setting up experiments in the SDK using <code class=\"language-text\">ModelSamplerDefinitionsBuilder</code> or the <code class=\"language-text\">ScenarioDefinitionsBuilder</code>. More on the differences between these features can be found in <a href=\":version/reference/run_deploy/multirun_setup\">Multirun Setup</a>.</p>\n<div class=\"ui segment warning message\" ><h4>Add Headless Main</h4>\n<p>Use the example provided above or the other run definitions builders provided to set up a headless main for running your simulations</p></div>\n<p>Now that you have a headless main class and an interactive console main, data outputting can be set up for importing and exporting data.</p>\n<h2 id=\"data-input--output\"><a href=\"#data-input--output\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Data Input &#x26; Output</h2>\n<p>Your models can output and input data regardless of interactive console or headless running mode. The objective of this section is to set up any input data channels (if they exist) and configure data outputs, for analysing results.</p>\n<p>The focus on this section will be on output data. Input data can be ingested in multiple ways and is less general and more specific to your model depending on whether your data is related to the network, initial agent states, interactions, etc.</p>\n<p>More information on input data can be found in the following sections:</p>\n<ol>\n<li><a href=\":version/features/input-output\">Input &#x26; Output</a></li>\n<li><a href=\":version/reference/data_management\">Data Management</a></li>\n<li><a href=\":version/reference/data_management/loading\">Loading Data</a></li>\n</ol>\n<p>Once configured, the Simudyne SDK automatically outputs simulation data in a structured and labelled format. </p>\n<p>Data can be exported in the following formats:</p>\n<ul>\n<li><a href=\":version/reference/data_export/parquet\">Parquet</a></li>\n<li><a href=\":version/reference/data_export/json\">JSON</a></li>\n<li><a href=\":version/reference/data_export/csv\">CSV</a></li>\n<li><a href=\":version/reference/data_export/sql\">MySQL</a></li>\n<li><a href=\":version/reference/data_export/hive\">Hive via Parquet</a></li>\n<li><a href=\":version/reference/data_export/h2\">H2 and JDBC</a></li>\n</ul>\n<p>Data can either be exported automatically using the model schema, via custom Simudyne SDK I/O channels, or via a user-defined method.</p>\n<p>Automatically exporting data is the fastest way to begin studying your agents and the system.</p>\n<p>The following configurations can be added to your simudyneSDK.properties file to set up automatic exporting via the model schema.</p>\n<p>Each configuration below will also require <code class=\"language-text\">core.export-path=output</code> to be added to the properties file. <code class=\"language-text\">output</code> can be swapped with the relevant file path or desired directory name which will be created in the projects root directory.</p>\n<h3 id=\"parquet\"><a href=\"#parquet\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Parquet</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">core.parquet-export.enabled=true\nfeature.interactive-parquet-output=true</code></pre></div>\n<h3 id=\"json\"><a href=\"#json\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>JSON</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">core.json-export.enabled=true</code></pre></div>\n<h3 id=\"csv\"><a href=\"#csv\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>CSV</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">core.csv-export.enabled=true</code></pre></div>\n<h3 id=\"mysql\"><a href=\"#mysql\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>MySQL</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">core.export.username=default\ncore.export.password=work12345\ncore.sql-export.enabled=true\ncore.sql-export-path=jdbc:mysql://localhost:3306/sdk</code></pre></div>\n<h3 id=\"h2\"><a href=\"#h2\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>H2</h3>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">core.export.username=default\ncore.export.password=work12345\ncore.hive-export.enabled=false\ncore.hive-export-path=hive2://localhost:10000/default</code></pre></div>\n<p>Once you have added one of the above options you will see data exported in the designated folder.</p>\n<p>For more information on data outputting, check out the following sections:</p>\n<ol>\n<li><a href=\":version/reference/data_management/outputting_data\">Data Outputting</a></li>\n<li><a href=\":version/reference/data_management/channels\">Output Channels</a></li>\n<li><a href=\":version/reference/data_export\">Output Export Options</a></li>\n</ol>\n<p>Now that data exporting has been configured and the state of every agent and the network are being dumped at each step, the model is ready for analysis in a data science tool or workflow.</p>\n<h2 id=\"analyzing-results-with-jupyter-or-another-data-science-tool\"><a href=\"#analyzing-results-with-jupyter-or-another-data-science-tool\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Analyzing Results with Jupyter or Another Data Science Tool</h2>\n<p>Hooking up your simulation to your preferred data science toolkit can be as simple as setting your data export path to a location that your Jupyter Notebook or data science toolkit can access.</p>\n<p>Additionally, and because the models built in the Simudyne SDK are packaged as a Java JAR file, it is possible to run the Simudyne SDK using a Python subprocess where you can parameterize and run models from a notebook. More information on this topic can be found in the <a href=\":version/tutorials/jupyter_notebook\">Jupyter Notebook Tutorial</a>.</p>","headings":[{"value":"Introduction","depth":2},{"value":"Iterative Model Building","depth":2},{"value":"Repeatable Models","depth":2},{"value":"Use Case Definition","depth":2},{"value":"1. Emergent / Reactive Properties","depth":3},{"value":"2. Agent Types","depth":3},{"value":"3. Agent Behaviors & Interactions","depth":3},{"value":"4. Environment - physical, social, economical, etc","depth":3},{"value":"Model Design & Class Organization","depth":2},{"value":"Groups of Agents","depth":3},{"value":"Actions and Sequences","depth":3},{"value":"Messages","depth":3},{"value":"Agents And Inheritance","depth":3},{"value":"External Classes","depth":3},{"value":"Implementation","depth":2},{"value":"Interactive Console Mode","depth":2},{"value":"Headless (BackendRunner) Mode","depth":2},{"value":"Data Input & Output","depth":2},{"value":"Parquet","depth":3},{"value":"JSON","depth":3},{"value":"CSV","depth":3},{"value":"MySQL","depth":3},{"value":"H2","depth":3},{"value":"Analyzing Results with Jupyter or Another Data Science Tool","depth":2}],"frontmatter":{"title":"Build Your First Model","toc":true,"experimental":null}},"site":{"siteMetadata":{"title":"Simudyne Docs","latestVersion":"2.6"}}},"pageContext":{"absolutePath":"/home/vsts/work/1/s/content/2.6/docs/overview/model_builder.md","versioned":false,"version":"2.6","kind":"docs","pagePath":"/overview/model_builder","chronology":{"prev":{"name":"Setup","path":"/overview/setup"},"next":{"name":"Introductory Course","path":"/overview/intro_course"}},"lastUpdated":"2026-04-21T13:56:54.866Z"}}