[alicebot-developer] Program# 2.0

mehri foreverlinux at yahoo.com
Tue Dec 5 08:21:11 PST 2006


Hi Nicholas, 

Thanks for the code contributions first of all.  Glad to see you back in the community.

Just a note though.  If you don't have things asynchronus right now where you can tell the interpreter to add a directory and it returns immediately exposing it as a webservice for multiple users would not be that great.

Imagine 5 users comming along and almost simutaneously trying to add the entire annotated alice set at once.  And imagine the 6th user putting in a simple "hi how are you?" to his already constructed bot.  The 6th user will have to wait for the other 5 users' bots to completely load first.  That could be several seconds before he gets his response or even several minutes. 

In a true multi-user,multi-bot,multi-threaded interpreter the user stands a better chance of getting his response a lot quicker.   Also, if you have a machine with multiple processors the bot engine will only take advantage of one processor.  Unless you instantiate a second instance of your interpreter as a process.

My bot currently is *not* a true mutli-user, multi-bot, multi-threaded interpreter.  That's what I'm working on right now and let me tell you....It complicates things exteremly as well as forces you to trade off some speed and memory usage to support it.  But it's fun and challenging to see if you can do it ;-)

Here is one great tip I picked up off of other bot interpreter writers (you might know this) for structuring your node mapper to support multi-user multi-bot and to be more memory efficient.  Make your stack go this way and add user id and bot id nodes:

topic -> [topic] -> that -> [that] -> word1 -> word2 -> wordn -> [userid] -> userId -> [botId] -> botId

So, if you have a user with an id of "woody" and a bot id of "mybot" and he was to add 

<category>
<pattern>hi</pattern>
<template>good</template>
</category>

your stack would look like this

* -> [topic] -> * [that] -> hi -> [userid] -> woody -> [botid] -> "mybot"



 ----- Original Message ----
From: Nicholas H.Tollervey <ntoll at ntoll.org>
To: Alicebot Developer Discussion <alicebot-developer at list.alicebot.org>
Sent: Tuesday, December 5, 2006 1:53:32 AM
Subject: Re: [alicebot-developer] Program# 2.0

Jeroen,

The quick answer is a very Zen yes and no. :-)

If you were to expose the library from behind say a web-service then, as
far as I know, .NET/IIS Mono/Apache will handle multi-threading in terms
of dealing with requests, queuing them and so on.

With regard to chat-sessions, that is left to the implementer of the
system to deal with as this is likely to be different from application
to application. My development philosophy for AIMLbot was to implement
only the minimum amount of functionality As I'm sure you realise,
AIMLbot provides a User class to be used to encapsulate a chat session.
It is capable of holding the chat history and contains an ID attribute
that should be used as a GUID (session ID?).

As with all new releases, there should be a version 2.1 released in
about a week where I'll fix some gremlins I missed for 2.0 and add a
couple of features I just didn't have time to get in for 2.0. One of
these "features" is adding a means of saving and loading User state via
XML and/or serializing the object - the developer only need worry about
how to store such information in a database or file-system for example.

I'd welcome any ideas or suggestions.

Thanks for the positive response,

Nicholas.

botmaster at mariekebot.nl wrote:
> Well that is just great!!
> just one - maybe a rather stupid - question:  does it support 
> multithreading?
> meaning it handles chatsessions seperately?
>
> i looked at the docs but did not find it yet.
>
> Jeroen
>
> ----- Original Message ----- 
> From: "Nicholas H.Tollervey" <ntoll at ntoll.org>
> To: "Alicebot Developer Discussion" <alicebot-developer at list.alicebot.org>
> Sent: Saturday, December 02, 2006 3:12 AM
> Subject: [alicebot-developer] Program# 2.0
>
>
> Hi,
>
> Just a quick note to say that I've just released a re-written .NET
> AIMLbot class library and moved the project to Sourceforge (project:
> AIMLbot). In this age of "2.0"s I thought it only apt that I jump on the
> bandwagon! :-)
>
> The original Program# was written over three years ago and was also my
> first project in C#. It became a vehicle for me to learn about the .NET
> platform.
>
> Although many people found it useful (it has been downloaded many
> thousands of times from my homepage) it was slow, not completely
> reliable and lacking in features.
>
> Now that I have lots of experience and knowledge of .NET under my belt,
> I have re-written this project from scratch to implement several
> modifications and improvements. These are:
>
>     * Better cross-platform compatibility. Support for .NET 1.1, 2.0 and
>       XNA as well as the open source MONO project (tested under version
>       1.1). Testing on Windows Vista with version 3.0 of the .NET
>       platform is pending.
>     * A completely new modular architecture to make it easier for
>       developers to extend and add functionality.
>     * A simpler and more logical API.
>     * Standards compliant AIML support with the option for custom tags.
>     * Very small size (currently only 52k).
>     * Very fast (over 30,000 categories processed in under a second).
>     * Inclusion of a comprehensive test suite including over 200 unit
>       tests (based upon NUnit <http://www.nunit.org/>).
>     * A means of saving the bot’s “brain” as a binary file
>       (Graphmaster.dat).
>     * Some simple code snippets and examples for developers to get
>       started (simple windows and console based applications as well as
>       a sample custom tags library).
>     * Appropriately commented code.
>     * Comprehensive documentation.
>
> Sourceforge is useful because it provides bug tracking, documentation,
> mailing lists, public forums, source control (subversion), file space
> and project management capabilities (among other things).
>
> Downloads, documentation, help and advice on implementing and using the
> library in your own projects can be found at the Sourceforge project
> page: http://aimlbot.sourceforge.net/ (Although I have yet to finish all
> the docs and upload the source to subversion - files are available for
> download).
>
> The project is now covered by the LGPL. As always, comments, suggestions
> and ideas are most welcome.
>
> Best wishes,
>
> Nicholas
>
> Nicholas H.Tollervey
> http://ntoll.org/
>
> _______________________________________________
> alicebot-developer mailing list
> alicebot-developer at list.alicebot.org
> http://list.alicebot.org/mailman/listinfo/alicebot-developer
>
>
>
>   

_______________________________________________
alicebot-developer mailing list
alicebot-developer at list.alicebot.org
http://list.alicebot.org/mailman/listinfo/alicebot-developer





 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.


More information about the alicebot-developer mailing list