Radiation model

def trips_ij(Ti, mi, mj, sij): """ Radiation model (see the paper "Universal predictability of mobility patterns in cities") Predict travel fluxes among the locations i and j based on population distribution Parameters ---------- Ti: int Total trips departing from i mi: int Population at location i mj: int Population at location j sij: int Total population in the circle with center i and radius rij (excluding i and j) Returns ------- Tij: int or float number of trips departing from location i to location j """ Tij = Ti * (mi * mj) / ((mi + sij) * (mi + mj + sij)) return Tij