Loading ...
Sorry, an error occurred while loading the content.

18177netlogo-R extension, multi-thread problems

Expand Messages
  • elc3p
    Aug 7, 2014
      Hi,
      I'm play with the netlogoR extension since 5 days and it's great when I run one simulation. Now I would like to run a multi-thread simulation (8 simulations) but I have some problems ...

      Run #2, RUNTIME ERROR: Extension exception: Error in R-Extension: Error in Eval:
      org.nlogo.api.ExtensionException: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
        NA/NaN/Inf dans 'y'

      error while farmer 206 running R:EVAL
        called by procedure STAT_R
        called by procedure GO
        called by procedure __EVALUATOR
      org.nlogo.nvm.EngineException: Extension exception: Error in R-Extension: Error in Eval:
      org.nlogo.api.ExtensionException: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
        NA/NaN/Inf dans 'y'

      I can see the error, but I don't understand why it work in one by one case? How work the netlogo-R communication? Netlogo open 8 instance of R if 8 simulations are runnning?

      A short part of my code

      to stat_R ;; des opération stat issu de R
        ;; create R list from turtles
        ask farmers [
          ;;definition de la taille de la mémoire
          ifelse length capital_list <= memory_size[
            set capital_list lput capital capital_list
            set my_time lput ticks my_time
          ][
           set capital_list lput capital capital_list
           set capital_list remove-item 0 capital_list

           set my_time lput ticks my_time
           set my_time remove-item 0 my_time
          ]

          ifelse length capital_list >= memory_size[
            ;; send the memory to R
            r:put "y" capital_list
            r:put "x" my_time

      ;      (r:putagent "farmers" self "capital_list" "my_time")
      ;      show r:get "farmers$capital_list"

           ;; calculate correlation between weight and height
           r:eval "fm <- lm(y ~ x)"
           set memory r:get "fm$coefficient[2]"
      ;     let co_dir r:get "co_dir"
      ;     show co_dir
          ][
            set memory 0
          ]
        ]
      end

      and if it can help I'm on fedora 20 (64bit), netlogo 5.0.5 (whit GUI and headless), netlogo-R 1.3, R 3.1 and

      java -version
      java version "1.7.0_65"
      OpenJDK Runtime Environment (fedora-2.5.1.3.fc20-x86_64 u65-b17)
      OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

      I have seen some issue about netlogo-R but it seem nothing for me ?

      https://groups.yahoo.com/neo/groups/netlogo-users/conversations/topics/14765

      http://netlogo-users.18673.x6.nabble.com/netlogo-r-extension-headless-td5001364.html

      best regards

      Etienne


    • Show all 3 messages in this topic