From 0e1229569ab035d42708e76822db0641bde82f2c Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 10 Mar 2026 22:21:43 +0000 Subject: [PATCH] simulation: added TODO regarding choosing neighbours for p2 --- src/simulation.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/simulation.c b/src/simulation.c index ae4774a..c8921ae 100644 --- a/src/simulation.c +++ b/src/simulation.c @@ -31,6 +31,9 @@ void thread_pick(struct ThreadState *state) { continue; } + // TODO: Instead of picking a RANDOM p2, why not choose a neighbour of p1? + // This way programs that are likely to replicate are replicating closer to + // themselves, and thus have a higher chance of further replication. u64 p2 = rand() % (SIMULATION_SIZE / SIZEOF_PROGRAM); while (p1 * 8 <= ((p2 * 8) + SIZEOF_PROGRAM) && p2 * 8 <= ((p1 * 8) + SIZEOF_PROGRAM))