This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| using Collide | |
| using PrimitiveCollisions | |
| # using CairoMakie | |
| using GLMakie | |
| using Random | |
| using StaticArrays | |
| CurMakie = GLMakie | |
| function glshape(c::PrimitiveCollisions.Circle) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| /* | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| 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] |