library(Dinamica)

openSession("DinamicaEGO19")

for (i in 1:5000) {
  dinamicaStep <- receiveNumber()
  if (dinamicaStep == -9999) {
    print("Execution was terminated!!!")
    break
  }
  
  random <- runif(1, 0.0, 1.0)
  
  sendNumber(random)

  print(paste(dinamicaStep, ":", random))
}
