<s> __author__ = '<STR_LIT>' <EOL> from pybrain . rl . environments . twoplayergames . pente import PenteGame <EOL> from pybrain . rl . environments . episodic import EpisodicTask <EOL> from . gomokutask import GomokuTask <EOL> from pybrain . rl . environments . twoplayergames . gomokuplayers import RandomGomokuPlayer <EOL> from inspect import isclass <EOL> class PenteTask ( GomokuTask ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , size , opponent = None , ** args ) : <EOL> EpisodicTask . __init__ ( self , PenteGame ( ( size , size ) ) ) <EOL> self . setArgs ( ** args ) <EOL> if opponent == None : <EOL> opponent = RandomGomokuPlayer ( self . env ) <EOL> elif isclass ( opponent ) : <EOL> opponent = opponent ( self . env ) <EOL> if not self . opponentStart : <EOL> opponent . color = PenteGame . WHITE <EOL> self . opponent = opponent <EOL> self . minmoves = <NUM_LIT:9> <EOL> self . maxmoves = self . env . size [ <NUM_LIT:0> ] * self . env . size [ <NUM_LIT:1> ] <EOL> self . reset ( ) </s>
