I finished working on an AI project that manages long strings (About 1300 characters each), the issue is the Out of local stack exception when trying to run the algorithm with a larger population (NP) than 10 or when trying a higher amount of iterations (G) than 20. Currently, i manage data using facts like this:
x(INDEX, NAMESTRING1, STRING1, NAMESTRING2, STRING2, FITNESS, VAR)
for storing current solutions
and
h(INDEX, NAMESTRING1, STRING1, NAMESTRING2, STRING2, FITNESS, VAR)
for storing possible solutions made by the algorithm.
Where STRING1 and STRING2 are two lists containing the characters of two DNA chains. These lists get modified adding '_' by the algorithm.
My code calls to assert/1 and retract/1 about NP * G * 4 * 2 times during each iteration.
I tried:
1.- Setting a higher stack limit, which seems to work with reservation.
2.- Using ! where necessary.
I was wondering if managing data with a list of lists would solve the problem.