From bf132f58580ae2c1ef7dbec995ab8d9972238cbb Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+ameligrana@users.noreply.github.com> Date: Sun, 22 Feb 2026 13:39:52 +0100 Subject: [PATCH 1/5] Use @unchecked for entity iteration in steps --- WolfSheep/Ark/WolfSheep.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WolfSheep/Ark/WolfSheep.jl b/WolfSheep/Ark/WolfSheep.jl index f50ac2c..6f58ea6 100644 --- a/WolfSheep/Ark/WolfSheep.jl +++ b/WolfSheep/Ark/WolfSheep.jl @@ -86,7 +86,7 @@ function swap_remove!(v::Vector{Entity}, x::Entity) end function sheep_step!(world::World, rng, entities, params, grass, sheep_grid) - for entity in entities + @unchecked for entity in entities pos, energy_comp = get_components(world, entity, (Position, Energy)) energy = energy_comp.e @@ -118,7 +118,7 @@ function sheep_step!(world::World, rng, entities, params, grass, sheep_grid) end function wolf_step!(world::World, rng, entities, params, sheep_grid) - for entity in entities + @unchecked for entity in entities pos, energy_comp = get_components(world, entity, (Position, Energy)) energy = energy_comp.e From 0804f04223dc38f81bda7cc37ac27b713f9a986c Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+ameligrana@users.noreply.github.com> Date: Sun, 22 Feb 2026 13:40:59 +0100 Subject: [PATCH 2/5] Update Schelling.jl --- Schelling/Ark/Schelling.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Schelling/Ark/Schelling.jl b/Schelling/Ark/Schelling.jl index 9e2efa5..07e20c5 100644 --- a/Schelling/Ark/Schelling.jl +++ b/Schelling/Ark/Schelling.jl @@ -58,7 +58,7 @@ function schelling_step!(world::World, rng) all_entities = buffers.entities shuffle!(rng, all_entities) - @inbounds for entity in all_entities + @inbounds @unchecked for entity in all_entities pos, group = get_components(world, entity, (Position, Group)) count_neighbors_same_group = 0 From fdd5d80a970327273e9cc61b70aaad44a0ce1a6f Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+ameligrana@users.noreply.github.com> Date: Sun, 22 Feb 2026 13:41:34 +0100 Subject: [PATCH 3/5] Update Flocking.jl --- Flocking/Ark/Flocking.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flocking/Ark/Flocking.jl b/Flocking/Ark/Flocking.jl index 4d9aacc..c1438c8 100644 --- a/Flocking/Ark/Flocking.jl +++ b/Flocking/Ark/Flocking.jl @@ -109,7 +109,7 @@ function flocking_step!(world::World, rng) entities = buffers.entities shuffle!(rng, entities) - for entity in entities + @unchecked for entity in entities pos_comp, vel_comp, param = get_components(world, entity, (Position, Velocity, BirdParams)) pos, vel = pos_comp.p, vel_comp.v From 39d9031cbb5d48f7caf3dc185e4a457975cc3e73 Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+ameligrana@users.noreply.github.com> Date: Sun, 22 Feb 2026 13:42:35 +0100 Subject: [PATCH 4/5] Update Project.toml --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 2c7921f..f9d64a3 100755 --- a/Project.toml +++ b/Project.toml @@ -8,4 +8,5 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] +Ark = "0.4" PrettyTables = "2" From 4fced2deb5b178ae8cfc6b67793e44292acceb7f Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+ameligrana@users.noreply.github.com> Date: Sun, 22 Feb 2026 21:17:16 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8d9f501..ad78595 100755 --- a/README.md +++ b/README.md @@ -14,14 +14,14 @@ These are the results of the latest comparison: | Model/Framework | Agents.jl 6.2.10 | Ark.jl 0.3.2 | MASON 22.0 | Netlogo 6.4.0 | Mesa 3.2.0 | |:------------------:|:------------------:|:--------------:|:------------:|:---------------:|:------------:| -| WolfSheep-small (Time-Ratio) | 1.0 | **0.39** | 5.29 | 9.94 | 9.38 | -| WolfSheep-large (Time-Ratio) | 1.0 | **0.24** | 7.8 | 4.81 | 3.28 | +| WolfSheep-small (Time-Ratio) | 1.0 | **0.34** | 5.29 | 9.94 | 9.38 | +| WolfSheep-large (Time-Ratio) | 1.0 | **0.14** | 7.8 | 4.81 | 3.28 | | WolfSheep (Lines of Code) | **73** | 149 | 202 | 137 (871) | 118 | -| Flocking-small (Time-Ratio) | 1.0 | **0.75** | 1.42 | 15.37 | 159.29 | -| Flocking-large (Time-Ratio) | 1.0 | **0.4** | 0.61 | 19.14 | 59.5 | +| Flocking-small (Time-Ratio) | 1.0 | **0.73** | 1.42 | 15.37 | 159.29 | +| Flocking-large (Time-Ratio) | 1.0 | **0.36** | 0.61 | 19.14 | 59.5 | | Flocking (Lines of Code) | **42** | 137 | 159 | 82 (689) | 94 | -| Schelling-small (Time-Ratio) | 1.0 | **0.67** | 1.19 | 11.39 | 29.73 | -| Schelling-large (Time-Ratio) | 1.0 | **0.68** | 1.51 | 14.33 | 26.66 | +| Schelling-small (Time-Ratio) | 1.0 | **0.61** | 1.19 | 11.39 | 29.73 | +| Schelling-large (Time-Ratio) | 1.0 | **0.59** | 1.51 | 14.33 | 26.66 | | Schelling (Lines of Code) | **26** | 78 | 129 | 54 (739) | 33 | ## How it works @@ -98,3 +98,4 @@ If you are using WSL make sure that you move to a folder inside the subsystem be +