Skip to content

Commit

Permalink
Utilities: apply Transition is part of mainHelpers.jl and not SE libr…
Browse files Browse the repository at this point in the history
…aries
  • Loading branch information
AtiyahElsheikh committed Dec 2, 2022
1 parent 480b8fa commit 85e9aca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mainHelpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ function initializeDemography!(model, poppars, workpars, mappars)
nothing
end

"Apply a transition function to an iterator."
function applyTransition!(people, transition, name, args...)
count = 0
for p in people
transition(p, args...)
count += 1
end

verbose() do
if name != ""
println(count, " agents processed in ", name)
end
end
end

# Atiyah: remove this for the primative API simulation function
# alivePeople(model) = Iterators.filter(a->alive(a), model.pop)
Expand Down

0 comments on commit 85e9aca

Please sign in to comment.