def loadAgent(theAgent): theSVNVersion=get_svn_codec_version() theCodecVersion=get_codec_version() client = ClientAgent(theAgent) host = Network.kLocalHost port = Network.kDefaultPort hostString = os.getenv("RLGLUE_HOST") portString = os.getenv("RLGLUE_PORT") if (hostString != None): host = hostString try: port = int(portString) except TypeError: port = Network.kDefaultPort print "RL-Glue Python Agent Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")" print "\tConnecting to " + host + " on port " + str(port) + "..." sys.stdout.flush() client.connect(host, port, Network.kRetryTimeout) print "\t Agent Codec Connected" client.runAgentEventLoop() client.close()
def loadAgentLikeScript(): agentModule = __import__(sys.argv[1]) agentClass = getattr(agentModule,sys.argv[1]) agent = agentClass() client = ClientAgent(agent) loadAgent(agent)
def loadAgent(theAgent): theSVNVersion=get_svn_codec_version() theCodecVersion=get_codec_version() client = ClientAgent(theAgent) host = Network.kLocalHost port = Network.kDefaultPort hostString = os.getenv("RLGLUE_HOST") portString = os.getenv("RLGLUE_PORT") if (hostString != None): host = hostString try: port = int(portString) except TypeError: port = Network.kDefaultPort print "RL-Glue Python Agent Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")" print "\tConnecting to " + host + " on port " + str(port) + "..." sys.stdout.flush() client.connect(host, port, Network.kRetryTimeout) print "\t Agent Codec Connected" client.runAgentEventLoop() client.close()
def loadAgent(theAgent): theSVNVersion=get_svn_codec_version() theCodecVersion=get_codec_version() client = ClientAgent(theAgent) host = Network.kLocalHost port = Network.kDefaultPort hostString = os.getenv("RLGLUE_HOST") portString = os.getenv("RLGLUE_PORT") if (hostString != None): host = hostString try: port = int(portString) except TypeError: port = Network.kDefaultPort print ("RL-Glue Python Agent Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")") # BEGIN: change made by: Akshay Narayan (05-01-2015:1653) print ("Number of objectives/rewards:" + Reward.getNumRewards()) # END: change made by: Akshay Narayan (05-01-2015:1653) print ("\tConnecting to " + host + " on port " + str(port) + "...") sys.stdout.flush() client.connect(host, port, Network.kRetryTimeout) print ("\t Agent Codec Connected") client.runAgentEventLoop() client.close()