Artificial Life

Experimental use of the Taichi numerical simulation and graphics language for live visuals and artificial life simulation. Made by Jack Armitage. For more info, see the iil-python-tools. Using an alpha version of Sardine. Video n°1, Video n°2.

from sardine import *
import taichi as ti
import numpy as np
import math
import tulvera as tul

c.bpm = 250
resx = 1920
resy = 1080
n = 8192
boids = tul.vera.Boids(resx, resy, n)
window = ti.ui.Window("Boids", (resx, resy))
canvas = window.get_canvas()

def gui_loop(d=0.5, i=0):
    a(gui_loop, d=1/16, i=i+1)

def param_loop(d=16, i=0):
    # boids.vis_radius[None] = P('40.0,80.0,150.0',i)
    # boids.max_speed[None] = P('1.0,2.0,3.0',i)
    boids.max_speed[None] = P('2*sin($/2)')
    a(param_loop, d=8, i=i+1)