DITRAS.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:DITRAS 作者: jonpappalord 项目源码 文件源码
def choose_location(self):

        # initialize variables
        S = len(self.location2visits)  # number of already visited locations

        if S == 0:
            self.home = self.__preferential_exploration(self.home)
            return self.home

        ## choose a probability to return o explore
        p_new = uniform(0, 1)

        if p_new <= self.rho * pow(S, -self.gamma):  # choose to return or explore
            # PREFERENTIAL EXPLORATION
            current_location = self.trajectory[-1]  # the last visited location
            return self.__preferential_exploration(current_location)

        else:
            # PREFERENTIAL RETURN
            return self.__preferential_return()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号