def support (self, rho, phi, delta, r, result): """ Actual values for the {ukn, occ, ept, cft} hypotheses depend on the uncertainty theory used Here we use a trivial 'hit-count' method """ delta_r = 0.02 k_occ =1.0 k_ept = 1.0 def f_occ(phi, delta,rho, r,delta_r, k_occ): # check that cell at (rho, phi) is in the field of view if (phi <= delta/2 and -phi <= delta/2): if abs(rho - r) <= delta_r: return k_occ * (1 - ((r - rho)/delta_r)**2) elif 0 <= rho < r - delta_r: return 0 elif rho >= r + delta_r: return 0 else: # Unknown scenario return 1.0 def f_ept(phi, delta,rho, r,delta_r, k_ept): # check that cell at (rho, phi) is in the field of view if (phi <= delta/2 and -phi <= delta/2): if abs(rho - r) <= delta_r: return k_ept * ((r - rho)/delta_r)**2 elif rho >= r: return 0 elif 0 <= rho< r- delta_r: return k_ept else: # Unknown scenario return 1.0 result.occ = f_occ(phi, delta,rho, r,delta_r, k_occ) result.ept = f_ept(phi, delta,rho, r,delta_r, k_ept) result.ukn = 0.0 result.cft = 0.0 return result def fuse (self, old, new): """ Fuse the new values for (ukn, occ, ept, cft) with the previous ones Return the fused values Fusion details depend on the uncertainty theory, here we use a trivial count of the 'occ', 'ept' hits """ # Fusion rule: Take maximum support value for each hypothesis old.occ = min(old.occ, new.occ) old.ept = min(old.ept, new.ept) self.ukn = old.ukn self.cft = old.cft return old