UNPKG

cacatoo

Version:

Building, exploring, and sharing spatially structured models

58 lines (46 loc) 2.54 kB
<!-- EXAMPLE FILE Cheater (HTML) This HTML file is different from other examples like GoL and prime, because instead of defining the model within the HTML itself, it merely includes the javascript code called cheater.js. The benefit of this is that you can easily swap between running your code interactively (in the browser), or just running the raw code on the commandline via 'nodejs cheater.js'. Apart from this difference, the HTML file is identical. --> <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="cheater_classes.js"> </script> <script src="cheater.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>