Code Monkey home page Code Monkey logo

rlglue's People

Contributors

smc77 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rlglue's Issues

R socket connection is not working

We should be able to open up a socket connection and write strings as in the following example.

From one command window, start rl_glue.

Start a python session and run:

import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("127.0.0.1", 4096))
sock.sendall('\x00\x00\x00\x01\x00\x00\x00\x00')

Then in RL-Glue you should see:

$ rl_glue 
RL-Glue Version 3.04, Build 909
RL-Glue is listening for connections on port=4096
    RL-Glue :: Experiment connected.

The equivalent in R doesn't work.

sock <- socketConnection(host="127.0.0.1", port=4096) 
write('\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00', sock)
close(sock)

Complete types

RL-Glue defines a set of abstract types, such as actions and observations.

RL-Glue to C encoding

RL-Glue uses C structures for data. So in python, they use the struct module to convert the output: https://docs.python.org/2/library/struct.html.

As an example, '10' becomes: '\x00\x00\x00\x01\x00\x00\x00\x00'

import struct
struct.pack("!i", 1) + struct.pack("!i", 0)

I'm not sure how to do the equivalent in R.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.