Tandysony / opensim4opencog

Exported from code.google.com/p/opensim4opencog
2 stars 2 forks source link

at_botClientCmd(X) #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Enhancement - 
wrappers for most cogrobot api's that take
an extra argument on the front, which identifies the bot.

This could be 'smart' - 
if it's of the form @atom  it's assumed to be a bot ID
if it's an atom or string it's assumed to be a bot's name

these commands should NOT change the current bot

It'd also be nice if there was a wrapper for setbot
so we don't have to do that through botcmd

Original issue reported on code.google.com by anneogb...@gmail.com on 10 May 2012 at 4:07

GoogleCodeExporter commented 9 years ago
This has morphed into 

"Design API to smoothly operate multiple bots"
cases:
1. I have a thread per bot

2. I have one thread that runs multiple bots, changing willy nilly

3. I have one thread, but I would like to set a current bot and nto
have to keep passsing the botid 

Original comment by anneogb...@gmail.com on 11 May 2012 at 5:18

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/opensim4opencog/source/detail?r=2807

case:
1. I have a thread per bot

%------------------------------------------------------------------------------
% much code uses botClient(Me) like botClientCmd and say/n  
%
% so current_bot(Me) is checked by botClient(Me) and is a thread_local predicate
%  
% usage:
%  set_current_bot(Me), .....  unset_current_bot(Me)
%
% bug prone antipattern, but it's supported:
%  current_bot(OldBot), set_current_bot(Me) .....   set_current_bot(OldBot)
% though current_bot(OldBot) may throw if not bot is set
% ------------------------------------------------------------------------------

case:
2. I have one thread that runs multiple bots, changing willy nilly
3. I have one thread, but I would like to set a current bot and nto
have to keep passing the botid

uses: current_bot(BotID)
botClientCmd(In)
botClientCmd(In,Out)
botClientCmd(In,WriteDelegate,Out)

at_botClientCmd(BotID,In)
at_botClientCmd(BotID,In,Out)
at_botClientCmd(BotID,In,WriteDelegate,Out)

Original comment by logicmoo@gmail.com on 14 May 2012 at 12:15