def __init__(self,configprovider:BaseConfigProvider): self._in_url=configprovider.GetConfigValueForSectionAndKey("Robots","GetURL") self._out_url=configprovider.GetConfigValueForSectionAndKey("Robots","PutURL") self._ack_udp_ip=configprovider.GetConfigValueForSectionAndKey("Robots","Ack_udp_ip") self._ack_udp_port = (int)(configprovider.GetConfigValueForSectionAndKey("Robots","Ack_udp_port")) self._ack_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self._ack_sock.bind((self._ack_udp_ip, self._ack_udp_port))
def GetMaze(configprovider: BaseConfigProvider) -> MazeFacade: filename = configprovider.GetConfigValueForSectionAndKey( 'MAZE', 'filename') filename = os.path.join(os.path.dirname(__file__), filename) parser = FileMazeParser(filename) # parser=DIYMazeParser(5) return MazeFacade(parser)
def __init__(self, config: BaseConfigProvider, initialposition: Position): BasicAntProducer.__init__(self, config) self.__AntsList = [] self.__Counter = 0 self.__InitialPosition = initialposition self.__max_num_of_ants = int( config.GetConfigValueForSectionAndKey('SimpleAnt', 'NumToProduce'))
def CreateFolder(configprovider: BaseConfigProvider, basename, subfolder): basicrunfolder = configprovider.GetConfigValueForSectionAndKey( 'Data', 'BaseFolder') newpath = os.path.join(basicrunfolder, os.path.join(basename, subfolder)) if not os.path.exists(newpath): os.makedirs(newpath) return newpath return None