From 8ac93db4cfb24bb0e673b36e1e5227138f97bca1 Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+Tortar@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:19:37 +0200 Subject: [PATCH 1/3] Use a faster ordering for heap --- src/core/model_event_queue.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/model_event_queue.jl b/src/core/model_event_queue.jl index 0ef6ae302a..c36d70bf97 100644 --- a/src/core/model_event_queue.jl +++ b/src/core/model_event_queue.jl @@ -160,7 +160,10 @@ function EventQueueABM( events = SizedVector{length(events), Union{typeof.(events)...}}(events...) # the queue stores pairs of (agent ID, event index) mapping them to their trigger time - queue = BinaryHeap(Base.By(last), Pair{Tuple{Int, Int}, Float64}[]) + queue = BinaryHeap( + Base.Order.By{typeof(last), DataStructures.FasterForward}(last, DataStructures.FasterForward()), + Pair{Tuple{Int, Int}, Float64}[] + ) agent_types = is_sumtype(A) ? values(allvariants(A)) : union_types(A) From 00fad69a069a0801837416d73d2a147876e76a30 Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+Tortar@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:22:53 +0200 Subject: [PATCH 2/3] simpler --- src/core/model_event_queue.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/model_event_queue.jl b/src/core/model_event_queue.jl index c36d70bf97..1a4c2214c8 100644 --- a/src/core/model_event_queue.jl +++ b/src/core/model_event_queue.jl @@ -161,7 +161,7 @@ function EventQueueABM( # the queue stores pairs of (agent ID, event index) mapping them to their trigger time queue = BinaryHeap( - Base.Order.By{typeof(last), DataStructures.FasterForward}(last, DataStructures.FasterForward()), + Base.By(last, DataStructures.FasterForward()), Pair{Tuple{Int, Int}, Float64}[] ) From d6096ec676ddbbbb56bfbd475e0628ebc7518453 Mon Sep 17 00:00:00 2001 From: Adriano Meligrana <68152031+Tortar@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:35:40 +0200 Subject: [PATCH 3/3] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 844f2722e9..82066bd857 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Agents" uuid = "46ada45e-f475-11e8-01d0-f70cc89e6671" authors = ["George Datseris", "Tim DuBois", "Aayush Sabharwal", "Ali Vahdati", "Adriano Meligrana"] -version = "6.1.3" +version = "6.1.4" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"