예제 #1
0
    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()