Dear all,
I hope this message finds you well.
I am currently working on a GAMA-based multi-agent simulation that communicates with an external Python server using WebSockets for reinforcement learning purposes.
I am encountering an issue when trying to send JSON-formatted data from GAMA to Python. I use the following code:
string json_data <- to_json(map_data);
do send to: "python_server" contents: json_data;
While the sending part seems to work, the messages received by the Python server contain unexpected internal GAMA tags such as: @b@@r@...
This makes the content unparsable as valid JSON, even though the string appears correct before sending.
I have tried several approaches
Using to_json() correctly
Filtering out non-JSON characters on the Python side
Ensuring the data structure is serializable
Checking if metadata is automatically added by GAMA during transmission.
Despite these efforts, the problem persists. My question is:
Is there a recommended way in GAMA to send clean JSON strings over WebSockets without additional metadata?
Thank you very much for your time and support.
Best regards,