<!--
###########################################################################################
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>
<head>
<title>Cacatoo examples</title>
</head>
<script>
/*-------------------------End user-defined code ---------------------*/
</script>
<body onload="cacatoo()">
<div class="", id="all_holder">
<div class="content" id="canvas_holder"> </div>
<div class="content" id="graph_holder"> </div>
<div class="content" id="form_holder"></div>
</div>
</body>
</html>
/*-----------------------Start user-defined code ---------------------*/
let sim;
var a = 0.01
var e = 0.005
var b = 3
var dt = 3
var disruption = 0.3
var vaccination = 0.15
var prev_vac = vaccination
var left = 10
var prev_left = left
function cacatoo() {
let config = {
title: "Epidemie",
description: "",
maxtime: 1000000,
ncol: 150,
nrow: 100, // dimensions of the grid to build
wrap: [false, true], // Wrap boundary [COLS, ROWS]
scale: 2, // scale of the grid (nxn pixels per grid cell
bgcolour:'white',
graph_interval: 5,
graph_update: 25
}
sim = new Simulation(config)
sim.makeGridmodel("Fitz");
sim.Fitz.colourGradient('W', 100, [255, 255, 255], [0, 150, 0]) // Will contain the ODEs, and show the abundance of PREDATORS
sim.Fitz.colourGradient('V', 100, [255, 255, 255], [0, 0, 0]) // Will contain the ODEs, and show the abundance of PREDATORS
sim.createDisplay_continuous({model:"Fitz", property:"V", label:"Infectiegolven", minval:0, maxval:1, decimals:3, nticks:3})
sim.addStatebrush("Fitz","V", 1.0, 10)
sim.createDisplay_continuous({model:"Fitz", property:"W", label:"Immuun (door vaccin of blootstelling)", minval:0, maxval:0.3, decimals:3, nticks:3})
sim.reset = function(all=true){
sim.time=0
if(all)sim.Fitz.resetPlots()
for (let i = 0; i < sim.Fitz.nc; i++)
{
for (let j = 0; j < sim.Fitz.nr; j++)
{
if(all){
sim.Fitz.grid[i][j].V = i == 0 ? 1 : 0.0
sim.Fitz.grid[i][j].W = 0
if(i>20) sim.Fitz.grid[i][j].vac = sim.rng.random() < vaccination? 1 : 0
}
else{
if(i==0) sim.Fitz.grid[i][j].V =...
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.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
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!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.