Beispiel #1
0
    def sonar_pass(self, loc):
        (r,c) = loc
#        self.grid[r][c] = True
        d = dist.DDist({1: self.grid[r][c], 0: (1-self.grid[r][c])})
        def prob_hit_given_wall(x):
            if x == 1:
                return dist.DDist({1.: 0.8, 0.: 0.2})
            return dist.DDist({1.: 0.1, 0.: 0.9})
        self.grid[r][c] = dist.bayes_rule(d, prob_hit_given_wall, 0).prob(1.)
Beispiel #2
0
    def sonar_hit(self, loc):
        (r,c) = loc
#        self.grid[r][c] = False
        d = dist.DDist({1:(self.grid[r][c]), 0:(1-self.grid[r][c])})
        def prob_hit_given_wall(x): #x is 0 or 1
            if x == 1:
                return dist.DDist({1.: 0.8, 0.: 0.2})
            return dist.DDist({1.: 0.1, 0.: 0.9})
        self.grid[r][c] = dist.bayes_rule(d, prob_hit_given_wall, 1).prob(1.)
Beispiel #3
0
    def sonar_hit(self, loc):
        (r, c) = loc
        #        self.grid[r][c] = False
        d = dist.DDist({1: (self.grid[r][c]), 0: (1 - self.grid[r][c])})

        def prob_hit_given_wall(x):  #x is 0 or 1
            if x == 1:
                return dist.DDist({1.: 0.8, 0.: 0.2})
            return dist.DDist({1.: 0.1, 0.: 0.9})

        self.grid[r][c] = dist.bayes_rule(d, prob_hit_given_wall, 1).prob(1.)
Beispiel #4
0
    def sonar_pass(self, loc):
        (r, c) = loc
        #        self.grid[r][c] = True
        d = dist.DDist({1: self.grid[r][c], 0: (1 - self.grid[r][c])})

        def prob_hit_given_wall(x):
            if x == 1:
                return dist.DDist({1.: 0.8, 0.: 0.2})
            return dist.DDist({1.: 0.1, 0.: 0.9})

        self.grid[r][c] = dist.bayes_rule(d, prob_hit_given_wall, 0).prob(1.)