soartech / jsoar

Pure Java implementation of the Soar cognitive architecture.
http://soartech.github.com/jsoar/
BSD 3-Clause "New" or "Revised" License
53 stars 19 forks source link

Add new RHS size function #137

Closed rezamini closed 1 year ago

rezamini commented 1 year ago

This Pull Request proposes the addition of a new RHS "size" function. The new function is based on the description provided in the Soar Manual documentation (3.3.6.6 Right-hand side Functions, page 79), and is designed to return an integer value representing the count of WME augmentations on a given ID argument. However as stated, it is important to note that providing a non-ID argument to the function will result in an error, indicating that the function is intended to be used specifically for counting WME augmentations on ID arguments.

The jsoar version of the codebase currently does not have this function implemented, and the proposed function will be a valuable addition to the codebase. It will provide developers with an easy and efficient way to count WME augmentations on ID arguments. The changes are backward-compatible and have no impact on the existing functionality of the codebase.

The proposed changes have been tested, and a test file has been included to verify the correct implementation of the new RHS size function.

marinier commented 1 year ago

Thank you very much for this contribution! I will take a look and merge when I get a chance, which may not be until the weekend or next week.

rezamini commented 1 year ago

Thank you for your response. I'm glad to hear that you will take a look at the Pull Request, and I appreciate your willingness to merge it into the main branch when you have the chance. If you have any questions or concerns about the changes, please let me know.

Additionally, I would be happy to help with any future contributions to add/port other RHS functions or other parts of the architecture. if there are any other parts of the architecture that could benefit from my contributions, please don't hesitate to let me know. I will do my best to make the time :)

marinier commented 1 year ago

Code looks good! Merged.

Depending on what you're looking to do, there are a lot of possibilities at varying levels of effort:

Small (1's of hours)

Medium (10's of hours)

Large (100's of hours)

Unfortunately, many of these are somewhat intertwined, especially at the medium/large level, so it may be hard to port one thing completely without touching other stuff, too. Additionally, in my experience the initial port of something goes quickly, and then it takes forever to get all the bugs out. For example, I probably did the initial port of working memory activation in ~2 hours, and then spent 20 hours trying to find the one typo I made that sometimes caused the activation numbers to come out wrong.

rezamini commented 1 year ago

Thank you very much for merging the PR. I'm glad that I could contribute to the project. :)

I appreciate the list of changes you provided and will review them to see if there are any that I can contribute to. I'll make a new pull request when I have something ready.