Skip to content

Instantly share code, notes, and snippets.

View AayushSabharwal's full-sized avatar

Aayush Sabharwal AayushSabharwal

View GitHub Profile
@AayushSabharwal
AayushSabharwal / plot.jl
Created October 11, 2022 13:33
Collide.jl demo
using Collide
using PrimitiveCollisions
# using CairoMakie
using GLMakie
using Random
using StaticArrays
CurMakie = GLMakie
function glshape(c::PrimitiveCollisions.Circle)
/*
Credit: https://gist.github.com/sharmaeklavya2/99ed35efbb639bbe7d7b46b89b74fea0
https://codeforces.com/blog/entry/18051
Output of segment tree range queries are modelled as elements of a monoid.
Updates on the segment tree are functions on the monoid.
*/
// O is a monoid
// F is a function
using Agents
using Agents.Pathfinding
using Random
using BenchmarkTools
@agent Foo ContinuousAgent{2} begin end
function initmodel(nagents = 100, adm = 0.0, seed = 42)
rng = MersenneTwister(seed)
unwalk = [abs.(rand(rng, Int, 2)).%100 .+ 1 for i in 1:5000]