MRC-CSO-SPHSU / UKSEABMLib.jl

MIT License
1 stars 1 forks source link

Improving implementation o movePeopleToEmptyHouse #23

Closed AtiyahElsheikh closed 1 year ago

AtiyahElsheikh commented 1 year ago

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.

AtiyahElsheikh commented 1 year ago

Additionally, current internal call to this function create temporary arrays for each function call leading to potential performance drawback.

AtiyahElsheikh commented 1 year ago

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.

AtiyahElsheikh commented 1 year ago

Internally, temporary arrays of references to empty houses are excessively created.

AtiyahElsheikh commented 1 year ago
AtiyahElsheikh commented 1 year ago

Improvements: