예제 #1
0
    def get_loglike(self, odor, pos_idx):
        """Return the relevant portion of the source loglikelihood map (i.e.,
        the probability of the source being at any given location in the
        environment given a specified odor value at a specified position."""

        # get idx of this odor
        odor_idx = nearest(odor, self.odor_domain)

        # get correct slice of loglikelihood map
        xidx, yidx, zidx = pos_idx
        xslice = slice(self.env.nx - 1 - xidx, 2 * self.env.nx - 1 - xidx)
        yslice = slice(self.env.ny - 1 - yidx, 2 * self.env.ny - 1 - yidx)
        zslice = slice(self.env.nz - 1 - zidx, 2 * self.env.nz - 1 - zidx)

        return self.loglike_map[odor_idx][xslice, yslice, zslice]
예제 #2
0
    def get_loglike(self, odor, pos_idx):
        """Return the relevant portion of the source loglikelihood map (i.e.,
        the probability of the source being at any given location in the
        environment given a specified odor value at a specified position."""

        # get idx of this odor
        odor_idx = nearest(odor, self.odor_domain)

        # get correct slice of loglikelihood map
        xidx, yidx, zidx = pos_idx
        xslice = slice(self.env.nx - 1 - xidx, 2*self.env.nx - 1 - xidx)
        yslice = slice(self.env.ny - 1 - yidx, 2*self.env.ny - 1 - yidx)
        zslice = slice(self.env.nz - 1 - zidx, 2*self.env.nz - 1 - zidx)

        return self.loglike_map[odor_idx][xslice, yslice, zslice]
예제 #3
0
 def odor(self, odor):
     self._odor = self.odor_domain[nearest(odor, self.odor_domain)]
예제 #4
0
 def odor(self, odor):
     self._odor = self.odor_domain[nearest(odor, self.odor_domain)]