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()))
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)
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()))
def performAction(self, action): EpisodicTask.performAction(self, action) if not self.isFinished(): EpisodicTask.performAction(self, self.opponent.getAction())
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())
def performAction(self, action): EpisodicTask.performAction(self, action) if not self.isFinished(): EpisodicTask.performAction(self, self.opponent.getAction())
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())