Exemple #1
0
def forceConnection():
	global network
	if network == None:
		
		theSVNVersion=get_svn_codec_version()
		theCodecVersion=get_codec_version()

		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 Experiment Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")"
		print "\tConnecting to " + host + " on port " + str(port) + "..."
		sys.stdout.flush()
		
		
		network = Network.Network()
		network.connect(host,port)
		network.clearSendBuffer()
		network.putInt(Network.kExperimentConnection)
		network.putInt(0)
		network.send()
Exemple #2
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+")")
	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()
Exemple #4
0
def forceConnection():
	global network
	if network == None:
		
		theSVNVersion=get_svn_codec_version()
		theCodecVersion=get_codec_version()

		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 Experiment Codec Version: "+theCodecVersion+" (Build "+theSVNVersion+")"
		print "\tConnecting to " + host + " on port " + str(port) + "..."
		sys.stdout.flush()
		
		
		network = Network.Network()
		network.connect(host,port)
		network.clearSendBuffer()
		network.putInt(Network.kExperimentConnection)
		network.putInt(0)
		network.send()
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()
Exemple #6
0
from rlglue.versions import get_codec_version

print get_codec_version()
Exemple #7
0
#! /usr/bin/env python

from distutils.core import setup
from rlglue.versions import get_codec_version
import rlglue



setup(name="RL_Glue_PythonCodec",
      version=get_codec_version(),
      description="RL-Glue Python Codec",
      author="Brian Tanner",
      author_email=" [email protected]",
      url="http://glue.rl-community.org/Home/Extensions/python-codec",
      packages=['rlglue','rlglue.agent','rlglue.environment','rlglue.network','rlglue.utils'],
	  license='Apache License Version 2.0',
     )

Exemple #8
0
#! /usr/bin/env python

from distutils.core import setup
from rlglue.versions import get_codec_version
import rlglue

setup(
    name="RL_Glue_PythonCodec",
    version=get_codec_version(),
    description="RL-Glue Python Codec",
    author="Brian Tanner",
    author_email=" [email protected]",
    url="http://glue.rl-community.org/Home/Extensions/python-codec",
    packages=[
        'rlglue', 'rlglue.agent', 'rlglue.environment', 'rlglue.network',
        'rlglue.utils'
    ],
    license='Apache License Version 2.0',
)