Facebook
From Davide, 1 Month ago, written in Plain Text.
This paste is a reply to Por ti cono from Davide - go back
Embed
Viewing differences between Por ti cono and Re: Por ti cono
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' '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 <= &lt;= delta/2 and -phi <= &lt;= delta/2):
                if abs(rho - r) <= &lt;= delta_r:
                    return k_occ * (1 -  ((r - rho)/delta_r)**2)
                elif 0 <= &lt;= rho &lt; r - delta_r:
                    return 0
                elif rho >= &gt;= 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 <= &lt;= delta/2 and -phi <= &lt;= delta/2):
                if abs(rho - r) <= &lt;= delta_r:
                    return k_ept * ((r - rho)/delta_r)**2 
                elif rho >= &gt;= r:
                    return 0
                elif 0 <= rho< &lt;= rho&lt; 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 resultresult
        
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