Esempio n. 1
0
def loadEnvironment(theEnvironment):
	theSVNVersion=get_svn_codec_version()
	theCodecVersion=get_codec_version()
	client = ClientEnvironment(theEnvironment)

	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 Environment Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")"
	print "\tConnecting to " + host + " on port " + str(port) + "..."
	sys.stdout.flush()

	client.connect(host, port, Network.kRetryTimeout)
	print "\t Environment Codec Connected"

	client.runEnvironmentEventLoop()
	client.close()
def loadEnvironment(theEnvironment):
	theSVNVersion=get_svn_codec_version()
	theCodecVersion=get_codec_version()
	client = ClientEnvironment(theEnvironment)

	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 Environment Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")")
	# BEGIN: change made by: Akshay Narayan (05-01-2015:2244)
	print ("Number of objectives/rewards:" + Reward.getNumRewards())
	# END: change made by: Akshay Narayan (05-01-2015:2244)
	print ("\tConnecting to " + host + " on port " + str(port) + "...")
	sys.stdout.flush()

	client.connect(host, port, Network.kRetryTimeout)
	print ("\t Environment Codec Connected")

	client.runEnvironmentEventLoop()
	client.close()