Events
So far, each of our agents run within their own virtual machine and communicating between them is not easy. To alleviate this, we can create a data structure called an event, which can be passed between agents or the sandbox itself.
Attributes
Creating an event is as simple as creating a table within Lua with a few restrictions. As events are serialized by the sandbox and passed to each virtual machine, only simple table attributes can be added to the event.
Each supported attribute is listed as follows:
Event attribute type |
Description |
---|---|
|
A true or false Lua value |
|
Any Lua number internally represented as a float value |
|
A code object, the sandbox, sandbox object, or an agent |
|
Any Lua string value |
|
Any vector created from |
Note
Events might not have nested tables within them; any unsupported attribute type will be discarded during the serialization. Currently, this is a limitation of event serialization of the C++ side of the...