gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Multiline R evaluation fails #3038

Closed sriramab closed 3 years ago

sriramab commented 4 years ago

Hi

In R multiple statements in a single line are separated by semi-colon. R_eval is evaluating only the first statement. Everything after the first semi-colon is ignored. I think there is something small that needs to be corrected. Please can you check.

model testR

global skills:[RSkill]{

init{
    do startR;

    string gama_value_from_R <- R_eval("y<-2");
    write (gama_value_from_R); // returns 2 

        string gama_value_from_R <- R_eval("y<-2;  x <- 10/y;  x");
    write (gama_value_from_R); // returns 2, should return 5, the value of x
}
}

experiment name type: gui {
    output {
        }
}
AlexisDrogoul commented 3 years ago

Should be fixed in commit by https://github.com/gama-platform/gama.experimental/commit/1e0cc6a9aab1d185453a1d7204f5e0263a733b5e. Once @hqnghi88 has setup the build for the 1.8.2 stream on experimental, it will be possible to test it (or you can do it directly if you run GAMA in Eclipse)

AlexisDrogoul commented 3 years ago

Closing it now (I've tested it myself in different scenarios). Reopen if it still manifests itself.