Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • \$\begingroup\$ Couple of things -- first, I'm pretty sure the outputs aren't being flushed. Second, once your process is invoked by the wrapper, it is kept running. Your current design assumes your process is invoked every time communication is sent to a wolf -- this would have been way too expensive in terms of process invocations, so instead I start the process and leave the communication channels open. So, you should have a main loop that continually reads lines from stdin and writes a line in reply to stdout, followed by a flush.console(). [cont] \$\endgroup\$ Commented Apr 5, 2014 at 12:47
  • \$\begingroup\$ [cont] My process wrapper should terminate the child process when the simulation ends. \$\endgroup\$ Commented Apr 5, 2014 at 12:48
  • \$\begingroup\$ @Rusher Here's the gist for a valid wrapper for @plannapus' R submission. Go here to download R. Install. Add R's bin folder to your PATH variable or equivalent, and you should be good (worked fine for me). \$\endgroup\$ Commented Apr 5, 2014 at 12:57
  • \$\begingroup\$ I think the culprit is the readlines command. Try using a readline or equiv. readlines will block until EOF. \$\endgroup\$ Commented Apr 5, 2014 at 13:38
  • \$\begingroup\$ I just added readLines it used to be scan. readLines with the second argument being 1 means it should stop at the first newline character. \$\endgroup\$ Commented Apr 5, 2014 at 13:44