コード例 #1
0
ファイル: main.py プロジェクト: pulkitkatdare/baby-ai-game
    def stepEnv(self, action=None):
        # If no manual action was specified by the user
        if action == None:
            action = selectAction(self.lastObs)

        obs, reward, done, info = self.env.step(action)

        self.showEnv(obs)
        self.lastObs = obs

        if done:
            self.resetEnv()
コード例 #2
0
ファイル: main.py プロジェクト: hantek/baby-ai-game
    def stepEnv(self, action=None):
        print('stepEnv : ',self.stepIdx)
        #print('action=%s' % action)

        # If no manual action was specified by the user
        if action == None:
            action = selectAction(self.lastObs)

        obs, reward, done, info = self.env.step(action)

        self.showEnv(obs)
        self.lastObs = obs
        self.stepIdx+=1
        if done:
            self.resetEnv()
コード例 #3
0
    def stepEnv(self, action=None):
        # If the environment doesn't supply a mission, get the
        # mission from the input text box
        if not hasattr(self.lastObs, 'mission'):
            text = self.missionBox.toPlainText()
            self.lastObs['mission'] = text

        # If no manual action was specified by the user
        if action == None:
            action = selectAction(self.lastObs)

        obs, reward, done, info = self.env.step(action)

        if not isinstance(obs, dict):
            obs = { 'image': obs, 'mission': '' }

        self.showEnv(obs)
        self.lastObs = obs

        if done:
            self.resetEnv()