Archi
Expert
Posts: 19
Joined: Wed May 03, 2017 11:13 pm

SimlBot.ReleaseBrain()

Sat Jun 03, 2017 8:01 am

Basically I'd love to have an option of releasing everything that was loaded via AddSiml() calls, while not necessarily creating new bot each time. There is simple rationale for that - I want to be able to entirely reload SIML brain from updated files, but not abort all ongoing <Late> tasks or clear all users and all of their sessions. Current SimlBot.Release() partially does that, but not everything is being cleared which leads to increased memory usage on further SIML files loading - this is logical, as that function was not coded for releasing only brain in the first place.

Would that be possible to add? Maybe there is already a way to achieve that? I think such option would be excellent, as it could make entire brain update process entirely transparent for end-users, not even interrupting their ongoing chat.

Thank you in advance.

JeffersonStack
Pro
Posts: 44
Joined: Fri Apr 05, 2013 1:20 am

Re: SimlBot.ReleaseBrain()

Sat Jun 03, 2017 8:22 am

omg popsicles :D releasing the Bot during a chat session would just kill it :shock:

are you just looking to reload the KB graph ?

CSharp Code

bot.GraphMaster.Children.Clear();
foreach (var user in bot.Users)
{
	user.MiniGraph.Children.Clear();
}
//Reload new KB immediately here :O

Archi
Expert
Posts: 19
Joined: Wed May 03, 2017 11:13 pm

Re: SimlBot.ReleaseBrain()

Sat Jun 03, 2017 8:24 am

FreakShow wrote:omg popsicles :D releasing the Bot during a chat session would just kill it :shock:

are you just looking to reload the KB graph ?

CSharp Code

bot.GraphMaster.Children.Clear();
foreach (var user in bot.Users)
{
	user.MiniGraph.Children.Clear();
}
//Reload new KB immediately here :O
Not if I use ReaderWriterLock and make SimlBot.Chat() inside reader lock, and update request in writer lock :). This is what I'm using right now, and it works nicely, apart from maximum of 30 seconds waiting time for bot reply during update.

And no, that is not sufficient - I must also clear everything that SIML loads, so concepts, models, sets, filters, regexes, and so on... Basically everything but Users and all data related to them (such as late tasks, session variables).

JeffersonStack
Pro
Posts: 44
Joined: Fri Apr 05, 2013 1:20 am

Re: SimlBot.ReleaseBrain()

Sat Jun 03, 2017 9:01 am

ima got some dynamic sets so I cant get rid of em. The graph master of SIML is sorta complicated so you got be be cautious when your clearing the kb.

you must have a better setup than mine... :D I just serialize user settings, send a message via event to notify users...my family members...that the bot is being restarted.

Return to “Feature Request and Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest