UNPKG

cacatoo

Version:

Building, exploring, and sharing spatially structured models

53 lines (43 loc) 2.46 kB
<!-- EXAMPLE FILE Checkpointing (HTML) This example illustrates how to use 'checkpoints'. Checkpoints are files written to the disk from which the grid-state can be recovered. This can be useful if you want to continue a certain simulation, but vary the parameters. Checkpointing is fully supported in node, but can also work in the browser when using a button to load a file (see checkpoint.js for how to add a checkpoint-button). --> <html> <script src="../../dist/cacatoo.js"></script> <!-- Include cacatoo library (compiled with rollup) --> <script src="../../lib/all.js"></script> <!-- Load other packages --> <link rel="stylesheet" href="../../style/cacatoo.css"> <!-- Set style sheet --> <!-- Include your model code here --> <script src="checkpointing.js"> </script> <body onload="cacatoo()"> <div class="header" id="header"> <h2>Cacatoo </h2> </div> <div class="content"> <table align="center" style="width:70%;"> <tr> <td style="width:50%"> Eight (or fewer) individuals surrounding an empty grid point will compete for replication. Individuals of species A are replicated by B with rate <b>B2A</b>. The more Bs are present, the higher the odds for A). Individuals of species B are replicated by type A with rate <b>A2B</b>. C receives replication from type B with rate <b>B2C</b>, but does not return the favour. I.o.w.:, A and B are mutualist species, with C parasitising on mutualist B. <br><br> The winner of all these interactions is decided according to a roulette wheel, with individuals having slices proportional to how much help they received. A constant called <b>stay_empty</b> determines the size of the black area in the roulette wheel, determining the chance that nobody replicates. </td> <td><img src="../../images/cheater.png" style="width:100%"></td> </tr> </table> </div> <div class="content" id="canvas_holder"></div> <div class="content" id="form_holder"></div> <div class="content" id="graph_holder"></div> <div class="footer" id="footer"></div> <div class="output" id="output"></div> </body> </html>