<!--
###########################################################################################
This is a JSFiddle example of "Cacatoo". This HTML page does not contain the code itself,
but determines where the grids, graphs, buttons, etc are placed. The real code is in the
Javascript Tab. I recommend enabling "Tabs (Columns)" under the settings in the top-right.
###########################################################################################
-->
<html>
<script src="https://bramvandijk88.github.io/cacatoo/scripts/cacatoo.js"></script>
<script src="https://bramvandijk88.github.io/cacatoo/scripts/all.js"></script> <!-- Dependencies
<link rel="stylesheet" href="style.css"> <!-- Set style sheet -->
<head>
<title>Cacatoo examples</title>
</head>
<script>
/*-------------------------End user-defined code ---------------------*/
</script>
<body onload="cacatoo()">
<div class="header" id="header">
<h2>Cacatoo (example project)</h2>
</div>
<div class="content" id="canvas_holder"> </div>
<div class="content" id="graph_holder"> </div>
<div class="content" id="form_holder"></div>
<div class="footer" id="footer"></div>
</body>
</html>
/*-----------------------Start user-defined code ---------------------*/
let sim;
function cacatoo() {
let config = {
title: "Serial transfer protocol",
description: "",
maxtime: 100000,
fastmode: true, // If possible, fast-mode will update the sim with more than 60 FPS.
// Note: fastmode is only useful/recommended if the sim can readily run
// at 60FPS without fast-mode, and may actually reduce the reported FPS
// Nevertheless, the final state of the grid is reaches sooner in real time.
ncol: 100,
nrow: 60, // dimensions of the grid to build
wrap: [true, true], // Wrap boundary [COLS, ROWS]
scale: 3, // scale of the grid (nxn pixels per grid cell)
statecolours: { 'alive': { 1: 'blue' } }, // The background state '0' is never drawn
skipbg_state: true, // Don't draw 0-state on grid (faster)
graph_interval: 1,
graph_update: 5,
show_gridname: true,
}
sim = new Simulation(config)
let influx = 0.0 // Continuous influx of resource into external environment
let uptake = 0.6 // Rate with which resources are taken up by cells
let upkeep = 0.02 // Upkeep used to keep the cell alive
let refresh_medium_every = 1440 // Interval for refreshing the medium ("minutes", 24h)
let refresh_medium_conc = 0.1 // Conc for refreshing the medium
sim.makeGridmodel("batchculture");
sim.createDisplay_continuous({model:"batchculture", property:"internal_resources", label:"Internal resources", minval:0, maxval:100, num_colours:40, fill: 'viridis'})
sim.createDisplay_continuous({model:"batchculture", property:"external_resources", label:"External resources", minval:0, maxval:100,...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.