Skip to content

Commit

Permalink
stable agent test
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreener64 committed Dec 20, 2024
1 parent b595e65 commit 7283638
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/agent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@
end
end

rng = Xoshiro(15)
temp = 1.0
boundary = RectangularBoundary(10.0)
n_steps = 1_000
n_people = 500
n_starting = 2
atoms = [Person(i, i <= n_starting ? infected : susceptible, 1.0, 0.1, 0.02) for i in 1:n_people]
coords = place_atoms(n_people, boundary; min_dist=0.1)
velocities = [random_velocity(1.0, temp; dims=2) for i in 1:n_people]
coords = place_atoms(n_people, boundary; min_dist=0.1, rng=rng)
velocities = [random_velocity(1.0, temp; dims=2, rng=rng) for i in 1:n_people]

lj = LennardJones(cutoff=DistanceCutoff(1.6), use_neighbors=true)
sir = SIRInteraction(0.5, 0.06, 0.01)
Expand Down Expand Up @@ -100,7 +101,7 @@
energy_units=NoUnits,
)

@time simulate!(sys, simulator, n_steps; n_threads=1)
@time simulate!(sys, simulator, n_steps; n_threads=1, rng=rng)

s, i, r = values(sys.loggers.SIR)[end]
@test s < 0.9
Expand Down

0 comments on commit 7283638

Please sign in to comment.