msayyadi / rl-glue-ext

Automatically exported from code.google.com/p/rl-glue-ext
0 stars 0 forks source link

Make Matlab Support Agent/Environment/Experiment all in one Matlab Instance #57

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is hard because:

 - Matlab is single threaded
 - The Network code in the Java Codec (which Matlab uses) is a singleton

I think with some work we could get around both of these issues.

Single-Threaded
-----------------
The agent and environment are reactive, they receive a message, then send a
response.  So, they are not much of a problem.  We can start the Java codec
in  non-blocking mode, and then the agent and environment can poll for a
message, respond if there is one, and otherwise not block.

The experiment is harder because it sends, then receives.  This means we
have to break it into two pieces.  But I think we could do:
- experiment send
- environment poll
- agent poll
- experiment receive

The experiment for each function, will know if the agent, env, or both will
be called, and in what order, so it can call the runEventLoop functions on
them and make sure things work out. It's a little hacky, but it should work.

Singleton:
----------
I think we'd need to break the singleton situation and have separate
sockets for each codec.  This would be harder, but not impossible.

Please STAR this issue if it is important to you.  Write a message here if
you have comments.

Original issue reported on code.google.com by brian.ta...@gmail.com on 6 Feb 2009 at 11:34

GoogleCodeExporter commented 8 years ago
Thought this would take more work, it didn't.  This is working as of revision 
650 or
slightly sooner.  Already downloadable as Matlab codec 1.03.

Original comment by brian.ta...@gmail.com on 7 Feb 2009 at 11:29