ps_simulator.alc 1014 B

12345678910111213141516171819202122232425262728293031
  1. include "primitives.alh"
  2. include "services.alh"
  3. include "modelling.alh"
  4. include "object_operations.alh"
  5. include "io.alh"
  6. Boolean function main(model : Element):
  7. String pdevs_client_taskname
  8. String the_output
  9. String the_input
  10. String devs_model
  11. pdevs_client_taskname = input()
  12. log("(PS) Got task name from console!")
  13. log(pdevs_client_taskname)
  14. while (True):
  15. if (has_input()):
  16. the_input = input()
  17. log("(PS) Got input from console!")
  18. log(cast_v2s(the_input))
  19. if (is_physical_string(the_input)):
  20. give_input_to_other(pdevs_client_taskname, the_input)
  21. else:
  22. give_input_to_other(pdevs_client_taskname, cast_v2s(the_input))
  23. if (other_has_output(pdevs_client_taskname)):
  24. the_output = get_output_from_other(pdevs_client_taskname)
  25. log("(PS) Got output from pdevs simulator!")
  26. log(the_output)
  27. output(the_output)
  28. sleep(0.05)