def testAgent(path, agent, port=DEFAULT_PORT):
 agent = adaptAgentObject(BenchmarkingAgent(agent))
 experiment = RLCExperiment(path, str(port))
 experiment.start()
 clientAgent = ClientAgent(agent)
 clientAgent.connect(DEFAULT_HOST, port, CLIENT_TIMEOUT)
 logging.info('Agent connected')
 clientAgent.runAgentEventLoop()
 clientAgent.close()
 logging.info('Agent finished')
 experiment.stop()
 return agent.agent.benchmark

def testAgent ( path , agent , port = DEFAULT_PORT ) : agent = adaptAgentObject ( BenchmarkingAgent ( agent ) ) experiment = RLCExperiment ( path , str ( port ) ) experiment . start ( ) clientAgent = ClientAgent ( agent ) clientAgent . connect ( DEFAULT_HOST , port , CLIENT_TIMEOUT ) logging . info ( 'Agent connected' ) clientAgent . runAgentEventLoop ( ) clientAgent . close ( ) logging . info ( 'Agent finished' ) experiment . stop ( ) return agent . agent . benchmark
test an agent once on a rlcompetition experiment .