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 __init__(self, agent): self.agent = agent self.network = Network.Network()
def __init__(self, environment): self.env = environment self.network = Network.Network()