Пример #1
0
 def reset(self):
     self.switched = False
     EpisodicTask.reset(self)
     if self.opponent.color == EuphoriaGame.BLACK:
         # first move by opponent
         self.opponent.game = self.env
         EpisodicTask.performAction(self, (EuphoriaGame.BLACK,self.opponent.getAction()))
Пример #2
0
    def performAction(self, action):
        """ Perform action on the underlying environment, i.e specify new asset
        allocation.

        Args:
            action (np.array): new allocation
        """
        # Cache new asset allocation for computing rewards
        self.newAllocation = action
        # Perform action
        EpisodicTask.performAction(self, action)
Пример #3
0
 def performAction(self, action):
     # agent.game = self.env
     if self.opponentStart:
         EpisodicTask.performAction(self, (EuphoriaGame.WHITE, action))
     else:
         EpisodicTask.performAction(self, (EuphoriaGame.BLACK, action))
     if not self.isFinished():
         self.opponent.game = self.env
         if self.opponentStart:
             EpisodicTask.performAction(self, (EuphoriaGame.BLACK,self.opponent.getAction()))
         else:
             EpisodicTask.performAction(self, (EuphoriaGame.WHITE,self.opponent.getAction()))
Пример #4
0
 def performAction(self, action):
     EpisodicTask.performAction(self, action)
     if not self.isFinished():
         EpisodicTask.performAction(self, self.opponent.getAction())
Пример #5
0
 def reset(self):
     self.switched = False
     EpisodicTask.reset(self)
     if self.opponent.color == CaptureGame.BLACK:
         # first move by opponent
         EpisodicTask.performAction(self, self.opponent.getAction())
Пример #6
0
 def performAction(self, action):
     EpisodicTask.performAction(self, action)
     if not self.isFinished():
         EpisodicTask.performAction(self, self.opponent.getAction())
Пример #7
0
 def reset(self):
     self.switched = False
     EpisodicTask.reset(self)
     if self.opponent.color == CaptureGame.BLACK:
         # first move by opponent
         EpisodicTask.performAction(self, self.opponent.getAction())