Closed AtiyahElsheikh closed 1 year ago
Additionally, current internal call to this function create temporary arrays for each function call leading to potential performance drawback.
Also, in many related internal functions return two types, either a house or nothing. It is worth to examine if returning only one type improves performance.
Internally, temporary arrays of references to empty houses are excessively created.
Improvements:
Within
function movePeopleToEmptyHouse!(people, dmax, allHouses, allTowns=Town[])
In module Simulate* allocate.jl in version 0.2 , argument dmax is of type symbol and an if else statements determines the dispatching to right implementation according to the dmax value (:near, :far, :hear).
An improved realization via multiple dispatch is realizable with traits.