Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory storage #68

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Memory storage #68

wants to merge 21 commits into from

Conversation

EltonCN
Copy link
Member

@EltonCN EltonCN commented Dec 9, 2024

Why was it necessary?

This PR implements Memory Storage, a memory synchronization mechanism. It allows the creation of distributed agents between different CST instances/nodes, and the creation of agents using CST-Java and CST-Python simultaneously.

How was it done?

The MemoryStorageCodelet has been implemented. By adding it to the agent, the codelet monitors existing memories and synchronizes them with a Redis server when needed.

Implementation details

In addition to the MemoryStorageCodelet, the MemoryEncoder, which transforms memories to and from Maps with JSON info, and the LamportTime, which implements a logical Lamport clock, were also implemented.

The full communication protocol details is provided in: https://h-iaac.github.io/CST-Python/_build/html/src/Memory%20Storage.html

How to test?

The Tests test communication between local nodes in Java. To run them, you need to have a Redis server available, which has been added to the test CI. If it is not available, the test is skipped.

A test was also implemented to verify the operation of other Memory Storage instances, which at the moment must be executed manually. The test was successfully executed with MS-Python.

Future works

Some more robust memory information encoding and typing system is still needed, allowing objects of arbitrary types to be synchronized.

@EltonCN EltonCN requested a review from rgudwin as a code owner December 9, 2024 18:55
Copy link

codeclimate bot commented Dec 12, 2024

Code Climate has analyzed commit b25903b and detected 6 issues on this pull request.

Here's the issue category breakdown:

Category Count
Clarity 5
Bug Risk 1

The test coverage on the diff in this pull request is 93.4% (90% is the threshold).

This pull request will bring the total coverage in the repository to 38.0% (1.7% change).

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant