#include <actor_script.h>
Inheritance diagram for NLAIAGENT::CActorScript:
Definition at line 49 of file actor_script.h.
Base class member method. | |
virtual std::string | getMethodeMemberDebugString (sint32, sint32) const |
virtual TQueue | getPrivateMember (const IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const |
virtual const IObjectIA * | getStaticMember (sint32) const |
virtual sint32 | getStaticMemberIndex (const IVarName &) const |
virtual sint32 | getStaticMemberSize () const |
virtual bool | haveActivity () const |
allow to know if the agent have an activity process to run. | |
virtual sint32 | isClassInheritedFrom (const NLAIAGENT::IVarName &) const |
virtual TQueue | isDeflautProccessMsg (const IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const |
virtual TQueue | isMember (const IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const |
virtual void | onKill (IConnectIA *A) |
Called by an agent who's destroyed te remove its references. | |
virtual void | processContinuation (IMessageBase *, IMessageBase *) |
virtual void | processMessages (IMessageBase *, IObjectIA *) |
virtual IObjectIA::CProcessResult | runActivity () |
Mailer do'nt have own activity. | |
virtual void | runChildren () |
virtual bool | runChildrenStepByStep () |
Activates the child agents. | |
virtual IObjectIA::CProcessResult | runMethodeMember (sint32 index, IObjectIA *) |
virtual IObjectIA::CProcessResult | runMethodeMember (sint32 heritance, sint32 index, IObjectIA *) |
virtual const CProcessResult & | runStep () |
virtual CProcessResult | sendMessage (const IVarName &, IObjectIA *) |
CProcessResult | sendMessageToDynmaicChild (const IVarName &, IObjectIA *) |
IObjectIA::CProcessResult | sendMethod (IObjectIA *) |
IObjectIA::CProcessResult | sendMethodCompoment (IObjectIA *) |
virtual bool | setStaticMember (sint32, IObjectIA *) |
Public Types | |
enum | TMethodNumDef { TSend, TSendComponent, TGetChildTag, TAddChildTag, TRemoveChild, TFather, TSelf, TGetName, TIsInherited, TGetClassName, TRunTellComponent, TRunAskComponent, TRunAskParentNotify, TRunTellParentNotify, TRunAskDebugString, TSetStatic, TGetValue, TSetValue, TDeflautProccessMsg, TInitComponent, TIsEUU, TAddSet, TLastM } |
This enum define ident for hard coded method that we have to import its under the script. More... | |
enum | TTypeCheck { CheckAll, CheckCount, DoNotCheck } |
Public Member Functions | |
void | activate () |
Activates the actor. | |
virtual void | addSet (const std::string &) |
Add a set for the agent. | |
virtual std::set< std::string >::const_iterator | beginSet () const |
CActorScript (IAgentManager *, IBasicAgent *, std::list< IObjectIA * > &, NLAISCRIPT::CAgentClass *) | |
CActorScript (const CActorScript &) | |
CActorScript (IAgentManager *, bool activated=false) | |
virtual void | callConstructor () |
virtual void | callFunction (std::string &, NLAIAGENT::IObjectIA *p=NULL) |
virtual void | cancel () |
virtual TQueue | canProcessMessage (const IVarName &) |
virtual const NLAIC::IBasicType * | clone () const |
Inherited functions. | |
void | connect (IConnectIA *b) |
sint32 | decRef () |
Decrement the reference of an object. | |
virtual std::set< std::string >::const_iterator | endSet () const |
virtual void | failure () |
virtual int | getBaseMethodCount () const |
Get an valid context for this instance. | |
virtual sint | getChildCoun () const |
const NLAISCRIPT::CAgentClass * | getClass () const |
virtual const NLAIAGENT::IVarName * | getClassName () const |
Returns the name of the class in the registry. | |
virtual void | getDebugString (std::string &t) const |
virtual const std::vector< NLAILOGIC::CGoal * > * | getGoalStack () |
virtual const CIdent | getIdentType () const |
virtual const std::string | getInfo () |
IMailBox * | getMail () const |
Get the mail box letter. | |
virtual sint32 | getMethodIndexSize () const |
virtual const IRefrence * | getOwner () const |
To get the top level parent of this agent. | |
IConnectIA * | getParent () const |
to get the agent parents | |
virtual TQueue | getPrivateMember (const IVarName *, const IVarName *, const IObjectIA &) const |
const sint32 & | getRef () const |
get the refence count. | |
virtual const CProcessResult & | getState () const |
Get the curent state of the agent. | |
const IObjectIA * | getStaticMember (const IVarName &compName) const |
virtual NLAILOGIC::CGoal * | getTopGoal () |
const CAgentScript * | getTopLevel () const |
virtual const NLAIC::CIdentType & | getType () const |
void | incRef () |
Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list. | |
virtual void | init (IObjectIA *) |
virtual bool | isa (const std::string &) const |
Test the set of the agent. | |
bool | isActivated () |
Returns true if the actor has a token. | |
virtual sint32 | isClassInheritedFrom (const IVarName &) const |
virtual bool | isEqual (const IBasicObjectIA &a) const |
Implementation of the isEqual of the IBasicObjectIA. | |
virtual bool | isLocal () |
If the result is true the object is loclal else its a representation of an object on the server. By the method return true. | |
virtual void | Kill () |
Call this function to destroy an agent including its referneces in other agents and its childs. | |
virtual void | Launch (const std::string &name, NLAIAGENT::IBasicAgent *) |
virtual void | load (NLMISC::IStream &is) |
virtual const NLAIC::IBasicType * | newInstance () const |
virtual void | onActivate () |
Callback called at the activation of the actor. | |
virtual void | onFailure (IObjectIA *) |
virtual void | onPause () |
These functions can be overloaded to have the actor execute something when paused or restarted. | |
virtual void | onRestart () |
virtual void | onSuccess (IObjectIA *) |
virtual void | onUnActivate () |
Callback called when the agent is unactivated. | |
operator const IWordNumRef & () const | |
to get a word num ref of the agents. | |
operator const IWordNumRef * () const | |
to get a word num ref pointer of the agents. | |
bool | operator== (const IBasicObjectIA &classType) const |
void | pause () |
Pauses the actor. | |
virtual float | priority () const |
Priority of the operator. | |
virtual void | processFailure (NLAIAGENT::IObjectIA *) |
virtual void | processMessages () |
virtual void | processSuccess (NLAIAGENT::IObjectIA *) |
virtual void | release () |
Release allow to release the pointer. The last release when the _Ref is nul delete the object. | |
void | removeConnection (IConnectIA *Agent) |
To release a connection. | |
void | restart () |
Restarts the actor. | |
virtual const CProcessResult & | run () |
virtual IObjectIA::CProcessResult | runMethodBase (int index, IObjectIA *) |
virtual IObjectIA::CProcessResult | runMethodBase (int heritance, int index, IObjectIA *) |
virtual IMessageBase * | runTell (const IMessageBase &m) |
virtual void | save (NLMISC::IStream &os) |
virtual IObjectIA::CProcessResult | sendMessage (IMessageBase *msg, IBasicAgent &receiver) |
Send message to an receiver agent. | |
virtual IObjectIA::CProcessResult | sendMessage (IMessageBase *msg) |
Send a message to the agent. | |
virtual CProcessResult | sendMessage (IObjectIA *) |
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
virtual void | setParent (const IWordNumRef *parent) |
to set the parent of the agents. | |
virtual void | setState (TProcessStatement s, IObjectIA *result) |
Set the state of an agent. | |
bool | setStaticMember (const IVarName &compName, IObjectIA *change) |
virtual void | setTopLevel (CAgentScript *) |
Set the top level agent of this one. | |
void | setTypeAt (uint64 t) |
That function allow user to change the 7 bit of the type field in the sid agent number;. | |
virtual void | success () |
void | unActivate () |
Unactivates the actor. | |
virtual | ~CActorScript () |
Static Public Member Functions | |
void | initAgentScript () |
void | initClass () |
void | releaseAgentScript () |
void | releaseClass () |
Static Public Attributes | |
const NLAIC::CIdentType | IdActorScript |
const NLAIC::CIdentType * | IdAgent = NULL |
const NLAIC::CIdentType | IdAgentScript |
NLAISCRIPT::COperandSimpleListOr * | IdMsgNotifyParent = NULL |
NLAISCRIPT::COperandSimple * | IdMsgNotifyParentClass = NULL |
NLAISCRIPT::COperandSimpleListOr * | msgPerf = NULL |
NLAISCRIPT::COperandSimpleListOr * | msgType = NULL |
NLAISCRIPT::CParam * | ParamFailureMsg = NULL |
NLAISCRIPT::CParam * | ParamGetValueMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdFailureMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdGetValueMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdInitComponentMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdSetValueMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdSuccessMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdTellComponentMsg = NULL |
NLAISCRIPT::CParam * | ParamInitComponentMsg = NULL |
NLAISCRIPT::CParam * | ParamRunParentNotify = NULL |
NLAISCRIPT::CParam * | ParamSetStatic |
NLAISCRIPT::CParam * | ParamSetValueMsg = NULL |
NLAISCRIPT::CParam * | ParamSuccessMsg = NULL |
NLAISCRIPT::CParam * | ParamTellComponentMsg = NULL |
TProcessStatement | ProcessBuzzy = processBuzzy |
TProcessStatement | ProcessEnd = processEnd |
TProcessStatement | ProcessError = processError |
TProcessStatement | ProcessIdle = processIdle |
TProcessStatement | ProcessLocked = processLocked |
CProcessResult | ProcessNotComplit = IObjectIA::CProcessResult(processNotComplete) |
CProcessResult | ProcessRun = IObjectIA::CProcessResult() |
NLAISCRIPT::CParam * | SendCompParamMessageScript = NULL |
NLAISCRIPT::CParam * | SendParamMessageScript = NULL |
CMethodCall ** | StaticMethod = NULL |
Protected Types | |
enum | c_funcs_id { fid_activate, fid_onActivate, fid_unActivate, fid_onUnActivate, fid_switch, fid_launch, fid_launch_goal, fid_launched, fid_pause, fid_restart, fid_success, fid_msg_success, fid_failure, fid_msg_failure, fid_nb_answers, fid_toplevel, fid_owner, fid_isactive, fid_last } |
Protected Member Functions | |
void | connectLoadStream (NLMISC::IStream &is) |
void | createComponents (std::list< IObjectIA * > &) |
void | refLoadStream (NLMISC::IStream &is) |
the loader of the class. | |
virtual IObjectIA * | run (const IMessageBase &m) |
virtual IMessageBase * | runAchieve (const IMessageBase &m) |
virtual IMessageBase * | runAsk (const IMessageBase &m) |
virtual IMessageBase * | runBreak (const IMessageBase &m) |
virtual IMessageBase * | runError (const IMessageBase &m) |
virtual IMessageBase * | runEven (const IMessageBase &m) |
virtual IMessageBase * | runExec (const IMessageBase &m) |
virtual IMessageBase * | runKill (const IMessageBase &m) |
virtual IMessageBase * | runService (const IMessageBase &m) |
virtual CProcessResult | sendBroadCast (IObjectIA *) |
void | setNumRef (const IWordNumRef &ref) |
virtual void | switchActor (std::vector< CComponentHandle * > &, bool stay_active=false) |
virtual void | switchActor (std::vector< CActorScript * > &, bool stay_active=false) |
virtual void | switchActor (CActorScript *, bool stay_active=false) |
Protected Attributes | |
std::vector< CComponentHandle * > | _Actors |
NLAISCRIPT::CAgentClass * | _AgentClass |
The creator of this instance. This useful for find scripted method entry point. | |
TBasicList | _AgentList |
IAgentManager * | _AgentManager |
The manager where the agent is run this manager have the agent script context. | |
IObjectIA ** | _Components |
Table of static compoments. | |
TListIBasic | _Connected |
TListIBasic | _Connection |
TSetDefNameAgent | _DynamicAgentName |
Map for store agent added in the dynamic child container. | |
sint | _iComponents |
bool | _IsActivated |
bool | _IsPaused |
std::list< IBasicAgent * > | _Launched |
IMailBox * | _Mail |
Box letter for communication service. | |
sint32 | _NbAnswers |
int | _NbComponents |
Nomber of static compoment. | |
bool | _OnActivate |
sint32 | _OnActivateIndex |
sint32 | _OnFailureIndex |
sint32 | _OnPauseIndex |
sint32 | _OnRestartIndex |
sint32 | _OnSuccessIndex |
sint32 | _OnUnActivateIndex |
CProcessResult | _RunState |
Internal state of the agent. | |
sint | _SizeChild |
CAgentScript * | _TopLevel |
std::set< std::string > | mapSet |
|
Reimplemented in NLAIAGENT::COperatorScript. Definition at line 53 of file actor_script.h.
00054 { 00055 fid_activate, 00056 fid_onActivate, 00057 fid_unActivate, 00058 fid_onUnActivate, 00059 fid_switch, 00060 fid_launch, 00061 fid_launch_goal, 00062 fid_launched, 00063 fid_pause, 00064 fid_restart, 00065 fid_success, 00066 fid_msg_success, 00067 fid_failure, 00068 fid_msg_failure, 00069 fid_nb_answers, 00070 fid_toplevel, 00071 fid_owner, 00072 fid_isactive, 00073 fid_last 00074 }; |
|
This enum define ident for hard coded method that we have to import its under the script.
Definition at line 69 of file agent_script.h.
00069 { 00070 TSend, 00071 TSendComponent, 00072 TGetChildTag, 00073 TAddChildTag, 00074 TRemoveChild, 00075 TFather, 00076 TSelf, 00077 TGetName, 00078 TIsInherited, 00079 TGetClassName, 00080 TRunTellComponent, 00081 TRunAskComponent, 00082 TRunAskParentNotify, 00083 TRunTellParentNotify, 00084 TRunAskDebugString, 00085 TSetStatic, 00086 TGetValue, 00087 TSetValue, 00088 // TGetValueReturn, /// Processes the "Tell(GetValueMsg)" msg resulting from a "Ask(GetValueMsg)" message sent. 00089 TDeflautProccessMsg, 00090 TInitComponent, 00091 TIsEUU, 00092 TAddSet, 00093 TLastM 00094 }; |
|
Definition at line 96 of file agent_script.h.
00096 { 00097 CheckAll, 00098 CheckCount, 00099 DoNotCheck 00100 }; |
|
Definition at line 95 of file actor_script.cpp. References _IsPaused, _NbAnswers, _OnActivateIndex, _OnUnActivateIndex, and _TopLevel. Referenced by clone(), and newInstance().
00095 : CAgentScript( manager ) 00096 { 00097 _IsActivated = false; 00098 _OnActivateIndex = -1; 00099 _OnUnActivateIndex = -1; 00100 _TopLevel = NULL; 00101 _IsPaused = false; 00102 _NbAnswers = 1; 00103 } |
|
Definition at line 71 of file actor_script.cpp. References _IsActivated, _IsPaused, _NbAnswers, _OnActivateIndex, _OnUnActivateIndex, and _TopLevel.
00071 : CAgentScript(a) 00072 { 00073 _IsActivated = a._IsActivated; 00074 _OnActivateIndex = a._OnActivateIndex; 00075 _OnUnActivateIndex = a._OnUnActivateIndex; 00076 _TopLevel = a._TopLevel; 00077 _IsPaused = false; 00078 _NbAnswers = a._NbAnswers; 00079 } |
|
Definition at line 81 of file actor_script.cpp. References _IsPaused, _NbAnswers, _OnActivateIndex, _OnUnActivateIndex, _TopLevel, and components.
00085 : CAgentScript(manager, father, components, actor_class ) 00086 { 00087 _IsActivated = false; 00088 _OnActivateIndex = -1; 00089 _OnUnActivateIndex = -1; 00090 _TopLevel = NULL; 00091 _IsPaused = false; 00092 _NbAnswers = 1; 00093 } |
|
Definition at line 105 of file actor_script.cpp. References _Launched, and nlinfo.
|
|
Activates the actor.
Definition at line 126 of file actor_script.cpp. References _OnActivateIndex, NLAIAGENT::CAgentScript::getClass(), NLAIAGENT::IConnectIA::getParent(), NLAISCRIPT::CAgentClass::isClassInheritedFrom(), NLAISCRIPT::CAgentClass::isMember(), onActivate(), r, and NLAIAGENT::TQueue. Referenced by NLAIAGENT::CSeqFsmScript::onSuccess(), NLAIAGENT::COperatorScript::run(), runMethodBase(), and switchActor().
00127 { 00128 if ( !_IsActivated ) 00129 { 00130 CAgentScript *father = (CAgentScript *) getParent(); 00131 00132 if ( father && ( ( CAgentScript *)father)->getClass()->isClassInheritedFrom( CStringVarName("Fsm") ) != -1 ) 00133 { 00134 ( (CFsmScript *)father)->activate( this ); 00135 } 00136 00137 // Looks for the function to call at the activation of the state 00138 static CStringVarName activate_func_name("OnActivate"); 00139 TQueue r = _AgentClass->isMember( NULL, &activate_func_name, NLAISCRIPT::CParam() ); 00140 if ( !r.empty() ) 00141 _OnActivateIndex = r.top().Index; 00142 else 00143 onActivate(); 00144 _IsActivated = true; 00145 } 00146 } |
|
Add a child to the agent. Child is added in a std::list<IBasicAgent *>. The method return the range of the child in the list. Implements NLAIAGENT::IBasicAgent. Reimplemented in NLAIAGENT::CLocalAgentMail. Definition at line 67 of file basic_agent.cpp. References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, NLAIAGENT::IMailBox::addMailBox(), NLAIAGENT::IBasicAgent::getMail(), and NLAIC::IPointerGestion::incRef(). Referenced by NLAIAGENT::CAgentScript::addDynamicAgent(), NLAIAGENT::IAgentComposite::IAgentComposite(), and NLAIAGENT::IAgentComposite::load().
00068 { 00069 p->incRef(); 00070 _AgentList.push_front((IBasicAgent *)p); 00071 // Donne au fils accès à la boite aux lettres du père 00072 p->getMail()->addMailBox( this->getMail() ); 00073 _SizeChild ++; 00074 00075 return _AgentList.begin(); 00076 } |
|
that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g); Reimplemented in NLAIAGENT::CMainAgentScript. Definition at line 811 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIAGENT::IAgentComposite::addChild(), NLAIAGENT::CStringType::getDebugString(), NLAIC::IBasicType::getType(), r, NLAIAGENT::IConnectIA::setParent(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), t, type, and uint.
00812 { 00813 #ifdef NL_DEBUG 00814 std::string dbg_name; 00815 const char *type; 00816 name.getDebugString( dbg_name ); 00817 type = (const char *)agent->getType(); 00818 const char *tname = dbg_name.c_str(); 00819 #endif 00820 IObjectIA::CProcessResult r; 00821 r.ResultState = IObjectIA::ProcessIdle; 00822 00823 agent->setParent( (const IWordNumRef *) *this ); 00824 CNotifyParentScript *m = new CNotifyParentScript(this); 00825 m->setSender(this); 00826 m->setPerformatif(IMessageBase::PTell); 00827 ((IObjectIA *) agent )->sendMessage(m); 00828 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent; 00829 const NLAIC::CTypeOfObject &t = agent->getType(); 00830 if((t.getValue() & b) == b) 00831 { 00832 ((CAgentScript *) agent )->setAgentManager(this); 00833 } 00834 _DynamicAgentName.insert(CKeyAgent(name,addChild( agent ))); 00835 00836 r.Result = NULL; 00837 return r; 00838 } |
|
Add an agent to the dynamic agent child. Method have an IBaseGroupType argument, this argument must store an CStringType first and an IObjectIA pointer memory next. The CStringType is the name of the agent. The IObjectIA pointer memory is the agent. Not that in generally this method is called by the script Reimplemented in NLAIAGENT::CMainAgentScript. Definition at line 761 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIAGENT::IAgentComposite::addChild(), NLAIC::IBasicType::clone(), NLAIAGENT::IBaseGroupType::getIterator(), NLAIC::IBasicType::getType(), NLAIAGENT::CConstIteratorContener::isInEnd(), r, s, NLAIAGENT::IConnectIA::setParent(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), sint, t, type, and uint. Referenced by Launch(), and NLAIAGENT::CAgentScript::runMethodBase().
00762 { 00763 CIteratorContener i = g->getIterator(); 00764 CStringType &s = (CStringType &)*i++; 00765 IBasicAgent *a = (IBasicAgent *)i++; 00766 IBasicAgent *o = a; 00767 sint n = 1; 00768 00769 #ifdef NL_DEBUG 00770 std::string name; 00771 const char *type; 00772 s.getDebugString(name); 00773 00774 type = (const char *)a->getType(); 00775 const char *tname = name.c_str(); 00776 #endif 00777 if(!i.isInEnd()) 00778 { 00779 n = (sint)((NLAIAGENT::INombreDefine *)i++)->getNumber(); 00780 } 00781 00782 IObjectIA::CProcessResult r; 00783 r.ResultState = IObjectIA::ProcessIdle; 00784 00785 while(n --) 00786 { 00787 o->setParent( (const IWordNumRef *) *this ); 00788 CNotifyParentScript *m = new CNotifyParentScript(this); 00789 //this->incRef(); 00790 m->setSender(this); 00791 m->setPerformatif(IMessageBase::PTell); 00792 ((IObjectIA *)o)->sendMessage(m); 00793 00794 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent; 00795 const NLAIC::CTypeOfObject &t = o->getType(); 00796 00797 if((t.getValue() & b) == b) 00798 { 00799 ((CAgentScript *)o)->setAgentManager(this); 00800 } 00801 00802 _DynamicAgentName.insert(CKeyAgent(s,addChild(o))); 00803 if(n) o = (IBasicAgent *)a->clone(); 00804 } 00805 00806 r.Result = NULL; 00807 00808 return r; 00809 } |
|
Definition at line 595 of file baseai.cpp. References NLAIAGENT::IConnectIA::_Connected. Referenced by NLAIAGENT::IConnectIA::connect(), and NLAIAGENT::IConnectIA::connectLoadStream().
00596 { 00597 _Connected.insert(a); 00598 } |
|
Definition at line 572 of file baseai.cpp. References NLAIAGENT::IConnectIA::_Connection. Referenced by NLAIAGENT::IConnectIA::connect(), and NLAIAGENT::IConnectIA::connectLoadStream().
00573 { 00574 _Connection.insert(a); 00575 } |
|
Method for adding operator.
Definition at line 1667 of file agent_script.cpp.
01668 {
01669 // _Operators.push_back(op);
01670 }
|
|
Add a set for the agent.
Definition at line 756 of file agent_script.cpp. References NLAIAGENT::CAgentScript::mapSet, and s. Referenced by NLAIAGENT::CAgentScript::runMethodBase().
00757 { 00758 mapSet.insert(s); 00759 } |
|
Definition at line 362 of file agent_script.h. References NLAIAGENT::CAgentScript::mapSet.
00363 { 00364 return mapSet.begin(); 00365 } |
|
Definition at line 2420 of file agent_script.cpp. References NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CAgentClass::findMethod(), NLAISCRIPT::CAgentClass::getBrancheCode(), NLAIAGENT::CAgentScript::getClass(), NLAIAGENT::CAgentScript::getType(), NLAISCRIPT::CCodeBrancheRun::run(), NLAISCRIPT::CCodeContext::Self, sint32, and uint32.
02421 { 02422 NLAIAGENT::CStringVarName constructor_func_name("Constructor"); 02423 sint32 id_func = getClass()->findMethod( constructor_func_name, NLAISCRIPT::CParam() ); 02424 02425 #ifdef NL_DEBUG 02426 02427 const char * ttt = (const char *) getType(); 02428 #endif 02429 if ( id_func != -1 ) 02430 { 02431 NLAISCRIPT::CStackPointer stack; 02432 NLAISCRIPT::CStackPointer heap; 02433 NLAISCRIPT::CCodeContext codeContext(stack, heap, NULL, this, NLAISCRIPT::CCallPrint::inputOutput); 02434 codeContext.Self = this; 02435 NLAISCRIPT::CCodeBrancheRun *o = (NLAISCRIPT::CCodeBrancheRun *) getClass()->getBrancheCode( id_func ).getCode(); 02436 codeContext.Code = o; 02437 int ip; 02438 if(codeContext.Code != NULL) ip = (uint32)*codeContext.Code; 02439 else ip =0; 02440 02441 *codeContext.Code = 0; 02442 02443 (void)o->run(codeContext); 02444 02445 *codeContext.Code = ip; 02446 02447 } 02448 } |
|
Definition at line 2450 of file agent_script.cpp. References NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CAgentClass::findMethod(), NLAISCRIPT::CAgentClass::getBrancheCode(), NLAIAGENT::CAgentScript::getClass(), NLAIAGENT::CAgentScript::getType(), NLAISCRIPT::CCodeBrancheRun::run(), NLAISCRIPT::CCodeContext::Self, sint32, and uint32.
02451 { 02452 NLAIAGENT::CStringVarName func_name( f_name.c_str() ); 02453 sint32 id_func = getClass()->findMethod( func_name, NLAISCRIPT::CParam() ); 02454 02455 #ifdef NL_DEBUG 02456 const char * ttt = (const char *) getType(); 02457 #endif 02458 if ( id_func != -1 ) 02459 { 02460 NLAISCRIPT::CStackPointer stack; 02461 NLAISCRIPT::CStackPointer heap; 02462 NLAISCRIPT::CCodeContext codeContext(stack, heap, NULL, this, NLAISCRIPT::CCallPrint::inputOutput); 02463 codeContext.Self = this; 02464 NLAISCRIPT::CCodeBrancheRun *o = (NLAISCRIPT::CCodeBrancheRun *) getClass()->getBrancheCode( id_func ).getCode(); 02465 codeContext.Code = o; 02466 int ip; 02467 if(codeContext.Code != NULL) ip = (uint32)*codeContext.Code; 02468 else ip =0; 02469 02470 *codeContext.Code = 0; 02471 02472 (void)o->run(codeContext); 02473 02474 *codeContext.Code = ip; 02475 02476 } 02477 } |
|
Reimplemented in NLAIAGENT::COperatorScript. Definition at line 921 of file actor_script.cpp. References unActivate().
00922 { 00923 unActivate(); 00924 } |
|
The method canProcessMessage(const IVarName &msgName) allow us to know if agent can preocess given by msgName. TQueue contain the liste of method (same as a run(msg)) that coud process the msg. Reimplemented in NLAIAGENT::CLocalAgentMail. Definition at line 350 of file baseai.cpp. References NLAIAGENT::TQueue. Referenced by NLAIAGENT::CLocalAgentMail::canProcessMessage().
00351 { 00352 return TQueue(); 00353 } |
|
Inherited functions.
Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 356 of file actor_script.cpp. References CActorScript().
00357 { 00358 CActorScript *m = new CActorScript(*this); 00359 return m; 00360 } |
|
When agent want to make connection he have to call this method to connect to an agent. When it call the B object is added in the connection list. Definition at line 555 of file baseai.cpp. References NLAIAGENT::IConnectIA::addInConnectedList(), and NLAIAGENT::IConnectIA::addInConnectionList(). Referenced by NLAIAGENT::CAgentWatchTimer::addAttrib(), NLAIAGENT::IAgentInput::addInputConnection(), NLAIAGENT::CLocalMailBox::addMailBox(), NLAIAGENT::CAgentWatchTimer::CAgentWatchTimer(), NLAIAGENT::CLocalAgentMail::CLocalAgentMail(), NLAIAGENT::CAgentOperation::connectOnChange(), and NLAIAGENT::IConnectIA::setParent().
00556 { 00557 b->addInConnectedList(this); 00558 addInConnectionList(b); 00559 } |
|
Definition at line 521 of file baseai.cpp. References NLAIAGENT::IConnectIA::addInConnectedList(), NLAIAGENT::IConnectIA::addInConnectionList(), num, NLMISC::IStream::serial(), and sint32. Referenced by NLAIAGENT::IConnectIA::IConnectIA(), and NLAIAGENT::IConnectIA::load().
00522 { 00523 IRefrence::refLoadStream(is); 00524 NLAIC::CIdentTypeAlloc id; 00525 sint32 i; 00526 is.serial( i ); 00527 00528 if(i) 00529 { 00530 while(i --) 00531 { 00532 is >> id; 00533 IWordNumRef *num = (IWordNumRef *)id.allocClass(); 00534 num->load(is); 00535 addInConnectionList((IConnectIA *)((const IRefrence *)*num)); 00536 delete num; 00537 } 00538 } 00539 00540 00541 is.serial(i); 00542 if(i) 00543 { 00544 while(i--) 00545 { 00546 is >> id; 00547 IWordNumRef *num = (IWordNumRef *)id.allocClass(); 00548 num->load(is); 00549 addInConnectedList((IConnectIA *)((const IRefrence *)*num)); 00550 delete num; 00551 } 00552 } 00553 } |
|
Definition at line 78 of file basic_agent.cpp. References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, and NLAIC::IBasicType::clone().
00079 { 00080 _AgentList.push_front((IBasicAgent *)p.clone()); 00081 _SizeChild ++; 00082 } |
|
Definition at line 2391 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, components, t, and uint. Referenced by NLAIAGENT::CAgentScript::CAgentScript().
02392 { 02393 _NbComponents = components.size(); 02394 if ( _NbComponents ) 02395 { 02396 _Components = new IObjectIA *[ _NbComponents ]; 02397 std::list<IObjectIA *>::iterator it_c = components.begin(); 02398 int id_c = 0; 02399 while ( it_c != components.end() ) 02400 { 02401 IObjectIA *o = (IObjectIA *)*it_c; 02402 _Components[id_c] = o; 02403 02404 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent; 02405 const NLAIC::CTypeOfObject &t = o->getType(); 02406 02407 if((t.getValue() & b) == b) 02408 { 02409 ((CAgentScript *)o)->setParent( (const IWordNumRef *) *this); 02410 } 02411 02412 it_c++; 02413 id_c++; 02414 } 02415 } 02416 else 02417 _Components = NULL; 02418 } |
|
Decrement the reference of an object.
Definition at line 93 of file abstract_interface.h. References NLAIC::IPointerGestion::_Ref, and sint32. Referenced by NLAIC::IPointerGestion::release(), and NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().
00094 {
00095 return --_Ref;
00096 }
|
|
Definition at line 367 of file agent_script.h. References NLAIAGENT::CAgentScript::mapSet.
00368 { 00369 return mapSet.end(); 00370 } |
|
Reimplemented in NLAILOGIC::CGoalPath. Definition at line 985 of file actor_script.cpp. References _OnFailureIndex, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::CAgentScript::getAgentManager(), NLAISCRIPT::CAgentClass::isMember(), onFailure(), r, NLAIAGENT::CAgentScript::runMethodeMember(), NLAISCRIPT::CCodeContext::Self, and NLAIAGENT::TQueue. Referenced by processFailure().
00986 { 00987 static CStringVarName onfailure_func_name("OnFailure"); 00988 TQueue r = _AgentClass->isMember( NULL, &onfailure_func_name, NLAISCRIPT::CParam() ); 00989 if ( !r.empty() ) 00990 { 00991 _OnFailureIndex = r.top().Index; 00992 const NLAIAGENT::IAgentManager *manager = getAgentManager(); 00993 if ( manager != NULL ) 00994 { 00995 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *) manager->getAgentContext(); 00996 context->Self = this; 00997 runMethodeMember( _OnFailureIndex ,context); 00998 _OnFailureIndex = -1; 00999 } 01000 } 01001 onFailure( NULL ); 01002 } |
|
Get an valid context for this instance.
Implements NLAIAGENT::IAgentManager. Reimplemented in NLAIAGENT::CMainAgentScript. Definition at line 296 of file agent_script.h. References NLAIAGENT::IAgentManager::getAgentContext(), and NLAIAGENT::CAgentScript::getAgentManager().
00297 { 00298 return getAgentManager()->getAgentContext(); 00299 } |
|
Get the manager of the instance.
Definition at line 271 of file agent_script.h. References NLAIAGENT::CAgentScript::_AgentManager. Referenced by NLAIAGENT::COperatorScript::checkPreconditions(), NLAIAGENT::COperatorScript::execOnActivate(), failure(), NLAIAGENT::CAgentScript::getAgentContext(), pause(), restart(), run(), success(), and unActivate().
00272 { 00273 return _AgentManager; 00274 } |
|
Get an valid context for this instance.
Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 769 of file actor_script.cpp. References fid_last, and NLAIAGENT::CAgentScript::getBaseMethodCount().
00770 { 00771 return CAgentScript::getBaseMethodCount() + fid_last; 00772 } |
|
Definition at line 358 of file agent.h. References NLAIAGENT::IAgentComposite::_SizeChild, and sint.
00359 { 00360 return _SizeChild; 00361 } |
|
get the mail boxe for scripted message.
Definition at line 512 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAISCRIPT::CAgentClass::getChildMessageIndex(), and sint32.
00513 { 00514 return _AgentClass->getChildMessageIndex( msg, child_index ); 00515 } |
|
Definition at line 421 of file agent_script.h. References NLAIAGENT::CAgentScript::_AgentClass. Referenced by activate(), NLAIAGENT::CAgentScript::callConstructor(), NLAIAGENT::CAgentScript::callFunction(), and unActivate().
00422 { 00423 return _AgentClass; 00424 } |
|
Implements NLMISC::IClassable. Reimplemented in NLAIC::CIdentType. Definition at line 116 of file abstract_interface.h. Referenced by NLAISCRIPT::CAgentClass::isClassInheritedFrom().
00117 { 00118 return std::string("<unnamed>"); 00119 } |
|
Returns the name of the class in the registry.
Definition at line 79 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, and NLAISCRIPT::IClassInterpret::getClassName(). Referenced by NLAIAGENT::CAgentScript::runMethodBase().
00080 { 00081 const NLAIAGENT::IVarName *classname; 00082 if ( _AgentClass != NULL ) 00083 { 00084 classname = _AgentClass->getClassName(); 00085 } 00086 else 00087 classname = new CStringVarName("<unknown>"); // Memory leak ? 00088 00089 return classname; 00090 } |
|
This is a Debug function, text is an character pointer to receive the debug text output, the debug text containe all think sensible to interset user. Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript. Definition at line 376 of file actor_script.cpp. References t.
00377 { 00378 t = "CActorScript "; 00379 if ( _IsActivated ) 00380 t += "<active>"; 00381 else 00382 t += "<idle>"; 00383 } |
|
Get agent from the dynamic agent child. Method have an IBaseGroupType argument where he must store an CStringType representative of the name of the agent. Definition at line 884 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIAGENT::IBaseGroupType::get(), r, s, sint, size, and x. Referenced by NLAIAGENT::CAgentScript::runMethodBase().
00885 { 00886 CStringType *s = (CStringType *)g->get(); 00887 IObjectIA::CProcessResult r; 00888 r.ResultState = IObjectIA::ProcessIdle; 00889 std::pair<TSetDefNameAgent::iterator,TSetDefNameAgent::iterator> p = _DynamicAgentName.equal_range(CKeyAgent(*s)); 00890 00891 if(p.first != p.second) 00892 { 00893 sint size = _DynamicAgentName.count(CKeyAgent(*s)); 00894 sint n = 0; 00895 CVectorGroupManager *x; 00896 x = new CVectorGroupManager(size); 00897 while(p.first != p.second) 00898 { 00899 (*p.first->Itr)->incRef(); 00900 x->set(n++, *p.first->Itr); 00901 p.first++; 00902 } 00903 00904 r.Result = x; 00905 return r; 00906 00907 } 00908 r.Result = new CVectorGroupManager(); 00909 return r; 00910 } |
|
Get the instance name of the agent in its manager Definition at line 1155 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIAGENT::IBaseGroupType::get(), NLAIAGENT::CKeyAgent::Itr, NLAIAGENT::CKeyAgent::Name, r, and s.
01156 { 01157 01158 IObjectIA::CProcessResult r; 01159 const IObjectIA *o = ((CLocalAgentMail *)g->get())->getHost(); 01160 TSetDefNameAgent::iterator i = _DynamicAgentName.begin(); 01161 01162 while(i != _DynamicAgentName.end()) 01163 { 01164 CKeyAgent key = *i; 01165 if( o == *key.Itr ) 01166 { 01167 CStringType *s = new CStringType(key.Name); 01168 r.Result = s; 01169 return r; 01170 } 01171 i ++; 01172 } 01173 r.Result = new CStringType(CStringVarName("Unknown")); 01174 return r; 01175 } |
|
Get the fact base of the agent, if not exist it return NULL.
Definition at line 386 of file agent_script.h.
00387 {
00388 return NULL;
00389 }
|
|
Get the creator of this instance.
Definition at line 277 of file agent_script.h. References NLAIAGENT::CAgentScript::_AgentClass. Referenced by NLAIAGENT::COperatorScript::getType(), and NLAIAGENT::CMainAgentScript::run().
00278 { 00279 return _AgentClass; 00280 } |
|
Definition at line 434 of file agent_script.h. Referenced by NLAIAGENT::COperatorScript::lookForGoals().
00435 {
00436 return NULL;
00437 }
|
|
Definition at line 480 of file baseai.cpp. References NLAIAGENT::IRefrence::_NumRef, NLAIAGENT::CNumericIndex::getId(), and NLAIAGENT::IWordNumRef::getNumIdent().
00481 {
00482 return CIdent(0,_NumRef->getNumIdent().getId());
00483 }
|
|
Definition at line 292 of file abstract_interface.h. References NLAIC::IBasicType::getDebugString(), and s.
00293 { 00294 std::string s; 00295 getDebugString(s); 00296 return s; 00297 } |
|
Get the mail box letter.
Definition at line 332 of file agents.cpp. References NLAIAGENT::IBasicAgent::_Mail. Referenced by NLAIAGENT::IAgentComposite::addChild(), NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIAGENT::IAgent::processMessages(), NLAIAGENT::CAgentScript::processMessages(), NLAIAGENT::IAgentComposite::removeChild(), NLAIAGENT::CMainAgentScript::run(), NLAIAGENT::IAgent::run(), NLAIAGENT::IAgent::runStep(), and NLAIAGENT::IBasicAgent::sendMessage().
00333 { 00334 return _Mail; 00335 } |
|
get the closure correspondent of the method indexed by index.
Definition at line 574 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAISCRIPT::CAgentClass::getBrancheCode(), NLAISCRIPT::CAgentClass::getMethodIndexSize(), NLAISCRIPT::IClassInterpret::getType(), NLAIAGENT::CAgentScript::getType(), index, and sint32.
00575 { 00576 if ( _AgentClass != NULL ) 00577 { 00578 #ifdef NL_DEBUG 00579 const char *dbg_class_name = (const char *) getType(); 00580 const char *dbg_base_class_name = (const char *) _AgentClass->getType(); 00581 00582 if ( index >= _AgentClass->getMethodIndexSize()) 00583 { 00584 throw NLAIE::CExceptionIndexError(); 00585 } 00586 #endif 00587 return (NLAISCRIPT::IOpCode *)_AgentClass->getBrancheCode(index).getCode(); 00588 } 00589 else 00590 return NULL; 00591 } |
|
get the closure correspondent of the method indexed by index in the base class inheritance.
Definition at line 558 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAISCRIPT::CAgentClass::getBrancheCode(), NLAISCRIPT::CAgentClass::getMethodIndexSize(), index, sint32, and NLAISCRIPT::CAgentClass::sizeVTable(). Referenced by NLAIAGENT::CAgentScript::processMessages(), and NLAIAGENT::CAgentScript::runMethodeMember().
00559 { 00560 #ifdef NL_DEBUG 00561 if ( index >= _AgentClass->getMethodIndexSize()) 00562 { 00563 throw NLAIE::CExceptionIndexError(); 00564 } 00565 00566 if ( inheritance >= _AgentClass->sizeVTable()) 00567 { 00568 throw NLAIE::CExceptionIndexError(); 00569 } 00570 #endif 00571 return (NLAISCRIPT::IOpCode *)_AgentClass->getBrancheCode(inheritance,index).getCode(); 00572 } |
|
The methode getMethodeMemberDebugString(sint32 heritance, sint32 index) return a string that define the name and the argument of the method Reimplemented from NLAIAGENT::IObjectIA. Definition at line 2012 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAIAGENT::CAgentScript::getBaseMethodCount(), NLAISCRIPT::CAgentClass::getBrancheCode(), NLAIAGENT::IBasicAgent::getMethodIndexSize(), sint32, NLAIAGENT::CAgentScript::TAddChildTag, NLAIAGENT::CAgentScript::TFather, NLAIAGENT::CAgentScript::TGetChildTag, NLAIAGENT::CAgentScript::TGetName, NLAIAGENT::CAgentScript::TGetValue, NLAIAGENT::CAgentScript::TInitComponent, NLAIAGENT::CAgentScript::TRunAskComponent, NLAIAGENT::CAgentScript::TRunAskParentNotify, NLAIAGENT::CAgentScript::TRunTellComponent, NLAIAGENT::CAgentScript::TRunTellParentNotify, NLAIAGENT::CAgentScript::TSelf, NLAIAGENT::CAgentScript::TSend, NLAIAGENT::CAgentScript::TSendComponent, NLAIAGENT::CAgentScript::TSetStatic, and NLAIAGENT::CAgentScript::TSetValue.
02013 { 02014 int i = id - getBaseMethodCount(); 02015 if(i >= 0) 02016 { 02017 std::string name; 02018 if(h) 02019 { 02020 _AgentClass->getBrancheCode(h,i).getName().getDebugString(name); 02021 _AgentClass->getBrancheCode(h,i).getParam().getDebugString(name); 02022 } 02023 else 02024 { 02025 _AgentClass->getBrancheCode(i).getName().getDebugString(name); 02026 _AgentClass->getBrancheCode(i).getParam().getDebugString(name); 02027 } 02028 return name; 02029 } 02030 02031 switch(id - IAgent::getMethodIndexSize()) 02032 { 02033 case TSend: 02034 { 02035 return std::string("CAgentScript::sendMessage(IMessage)"); 02036 } 02037 02038 case TSendComponent: 02039 { 02040 return std::string("CAgentScript::sendMessage(String,IMessage)"); 02041 } 02042 02043 case TGetChildTag: 02044 { 02045 return std::string("CAgentScript::getDynamicAgent(String)"); 02046 } 02047 02048 case TAddChildTag: 02049 { 02050 return std::string("CAgentScript::addDynamicAgent(String,IAgent)"); 02051 } 02052 case TFather: 02053 { 02054 return std::string("CAgentScript::Father()"); 02055 } 02056 02057 case TSelf: 02058 { 02059 return std::string("CAgentScript::Self()"); 02060 } 02061 case TGetName: 02062 { 02063 return std::string("CAgentScript::GetAgentName()"); 02064 } 02065 02066 case TRunAskParentNotify: 02067 { 02068 return std::string("CAgentScript::runAskParentNotify(CNotifyParent)"); 02069 } 02070 02071 case TRunTellParentNotify: 02072 { 02073 return std::string("CAgentScript::runTellarentNotify(CNotifyParent)"); 02074 } 02075 02076 case TRunAskComponent: 02077 case TRunTellComponent: 02078 { 02079 return std::string("CAgentScript::runTell/AskCompoment(MsgTellCompoment)"); 02080 } 02081 case TSetStatic: 02082 { 02083 return std::string("CAgentScript::updateStaticMember(String, IObjectIA *)"); 02084 } 02085 02086 case TGetValue: 02087 { 02088 return std::string("CAgentScript::runAskGetValue(MsgGetValue)"); 02089 } 02090 02091 case TSetValue: 02092 { 02093 return std::string("CAgentScript::runTellSetValue(MsgGetValue)"); 02094 } 02095 02096 case TInitComponent: 02097 { 02098 return std::string("CAgentScript::runInitComponent(MsgGetValue)"); 02099 } 02100 02101 02102 default: 02103 return IAgentManager::getMethodeMemberDebugString(h,id); 02104 } 02105 } |
|
getMethodIndexSize define the nomber of method define in the class. Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 446 of file actor_script.cpp. References fid_last, NLAIAGENT::CAgentScript::getMethodIndexSize(), and sint32.
00447 { 00448 return CAgentScript::getMethodIndexSize() + fid_last; 00449 } |
|
To get the top level parent of this agent.
Definition at line 402 of file baseai.cpp. References NLAIAGENT::IRefrence::getParent().
|
|
to get the agent parents
Reimplemented from NLAIAGENT::IRefrence. Definition at line 511 of file baseai.cpp. Referenced by activate(), NLAIAGENT::COperatorScript::calcPriority(), NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::COperatorScript::lookForGoals(), NLAIAGENT::CLocalMailBox::newInstance(), NLAIAGENT::IAgent::newInstance(), NLAIAGENT::CActor::newInstance(), NLAIAGENT::IConnectIA::onKill(), NLAIAGENT::IBasicAgent::runAsk(), NLAIAGENT::CAgentScript::runAskDebugString(), NLAIAGENT::CAgentScript::runAskParentNotify(), NLAIAGENT::CAgentScript::runMethodBase(), runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), NLAIAGENT::CAgentScript::runTellParentNotify(), NLAIAGENT::IConnectIA::setParent(), and unActivate().
00512 { 00513 return (IConnectIA *)IRefrence::getParent(); 00514 } |
|
Definition at line 2228 of file agent_script.cpp. References NLAIAGENT::IVarName::getString(), NLAIAGENT::isTemplateMember(), param, and NLAIAGENT::TQueue. Referenced by getPrivateMember(), and NLAIAGENT::CAgentScript::isMember().
02229 { 02230 02231 #ifdef NL_DEBUG 02232 const char *dgb_meth_name = methodName->getString(); 02233 #endif 02234 return isTemplateMember(CAgentScript::StaticMethod,CAgentScript::TLastM,IAgent::getMethodIndexSize(),className,methodName,param); 02235 } |
|
Reimplemented in NLAIAGENT::COperatorScript. Definition at line 774 of file actor_script.cpp. References fid_failure, fid_isactive, fid_launch, fid_launch_goal, fid_launched, fid_msg_failure, fid_msg_success, fid_nb_answers, fid_onActivate, fid_onUnActivate, fid_owner, fid_pause, fid_restart, fid_success, fid_switch, fid_toplevel, NLAIAGENT::CAgentScript::getPrivateMember(), param, ParamFailureMsg, ParamSuccessMsg, and NLAIAGENT::TQueue.
00775 { 00776 00777 TQueue result; 00778 00779 static NLAIAGENT::CStringVarName activate_name("activate"); 00780 static NLAIAGENT::CStringVarName onactivate_name("onActivate"); 00781 static NLAIAGENT::CStringVarName unactivate_name("unActivate"); 00782 static NLAIAGENT::CStringVarName onunactivate_name("onUnActivate"); 00783 static NLAIAGENT::CStringVarName switch_name("switch"); 00784 static NLAIAGENT::CStringVarName launch_name("Launch"); 00785 static NLAIAGENT::CStringVarName launch_goal_name("LaunchGoals"); 00786 static NLAIAGENT::CStringVarName launched_name("Launched"); 00787 static NLAIAGENT::CStringVarName tell_name("RunTell"); 00788 static NLAIAGENT::CStringVarName toplevel_name("TopLevel"); 00789 static NLAIAGENT::CStringVarName owner_name("Owner"); 00790 static NLAIAGENT::CStringVarName success_name("Success"); 00791 static NLAIAGENT::CStringVarName failure_name("Failure"); 00792 static NLAIAGENT::CStringVarName pause_name("Pause"); 00793 static NLAIAGENT::CStringVarName restart_name("Restart"); 00794 static NLAIAGENT::CStringVarName isactive_name("IsActivated"); 00795 static NLAIAGENT::CStringVarName _NbAnswers_name("WaitFor"); 00796 00797 00798 if ( *name == activate_name ) 00799 { 00800 NLAIAGENT::CObjectType *r_type = new NLAIAGENT::CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00801 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_activate, 0.0,NULL, r_type ) ); 00802 } 00803 00804 if ( *name == onactivate_name ) 00805 { 00806 NLAIAGENT::CObjectType *r_type = new NLAIAGENT::CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00807 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_onActivate , 0.0,NULL, r_type ) ); 00808 } 00809 00810 if ( *name == unactivate_name ) 00811 { 00812 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00813 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_onUnActivate, 0.0,NULL, r_type ) ); 00814 } 00815 00816 if ( *name == onunactivate_name ) 00817 { 00818 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00819 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_unActivate, 0.0,NULL, r_type ) ); 00820 } 00821 00822 if ( *name == switch_name ) 00823 { 00824 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00825 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_switch, 0.0, NULL, r_type ) ); 00826 } 00827 00828 if ( *name == launch_name ) 00829 { 00830 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00831 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_launch, 0.0, NULL, r_type ) ); 00832 } 00833 00834 if ( *name == launch_goal_name ) 00835 { 00836 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00837 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_launch_goal, 0.0, NULL, r_type ) ); 00838 } 00839 00840 if ( *name == launched_name ) 00841 { 00842 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIAGENT::CVectorGroupType::IdVectorGroupType ) ); 00843 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_launched, 0.0, NULL, r_type ) ); 00844 } 00845 00846 // Processes succes and failure functions 00847 if ( *name == tell_name ) 00848 { 00849 double d; 00850 d = ((NLAISCRIPT::CParam &)*ParamSuccessMsg).eval((NLAISCRIPT::CParam &)param); 00851 if ( d >= 0.0 ) 00852 { 00853 NLAIAGENT::CObjectType *r_type = new NLAIAGENT::CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00854 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_msg_success, 0.0,NULL, r_type ) ); 00855 } 00856 00857 d = ((NLAISCRIPT::CParam &)*ParamFailureMsg).eval((NLAISCRIPT::CParam &)param); 00858 if ( d >= 0.0 ) 00859 { 00860 NLAIAGENT::CObjectType *r_type = new NLAIAGENT::CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00861 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_msg_failure, 0.0,NULL, r_type ) ); 00862 } 00863 } 00864 00865 if ( *name == toplevel_name ) 00866 { 00867 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00868 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_toplevel, 0.0, NULL, r_type ) ); 00869 } 00870 00871 if ( *name == _NbAnswers_name ) 00872 { 00873 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00874 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_nb_answers, 0.0, NULL, r_type ) ); 00875 } 00876 00877 00878 if ( *name == owner_name ) 00879 { 00880 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00881 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_owner, 0.0, NULL, r_type ) ); 00882 } 00883 00884 if ( *name == success_name ) 00885 { 00886 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00887 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_success, 0.0, NULL, r_type ) ); 00888 } 00889 00890 if ( *name == failure_name ) 00891 { 00892 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00893 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_failure, 0.0, NULL, r_type ) ); 00894 } 00895 00896 if ( *name == pause_name ) 00897 { 00898 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00899 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_pause, 0.0, NULL, r_type ) ); 00900 } 00901 00902 if ( *name == restart_name ) 00903 { 00904 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00905 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_restart, 0.0, NULL, r_type ) ); 00906 } 00907 00908 if ( *name == isactive_name ) 00909 { 00910 CObjectType *r_type = new CObjectType( new NLAIC::CIdentType( NLAIC::CIdentType::VoidType ) ); 00911 result.push( NLAIAGENT::CIdMethod( CAgentScript::getMethodIndexSize() + fid_isactive, 0.0, NULL, r_type ) ); 00912 } 00913 00914 if ( result.empty() ) 00915 return CAgentScript::getPrivateMember(className, name, param); 00916 00917 return result; 00918 } |
|
get the refence count.
Definition at line 99 of file abstract_interface.h. References NLAIC::IPointerGestion::_Ref, and sint32. Referenced by NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().
00100 {
00101 return _Ref;
00102 }
|
|
Get the curent state of the agent.
Implements NLAIAGENT::IConnectIA. Definition at line 309 of file agents.cpp. References NLAIAGENT::IBasicAgent::_RunState. Referenced by NLAIAGENT::CMainAgentScript::run(), NLAIAGENT::IAgent::run(), NLAIAGENT::CAgentClockTimer::runActivity(), NLAIAGENT::CAgentWatchTimer::runActivity(), NLAIAGENT::IAgent::runChildren(), NLAIAGENT::IAgent::runChildrenStepByStep(), and NLAIAGENT::IAgent::runStep().
00310 { 00311 return _RunState; 00312 } |
|
to get the pointer of a given components referened by an string. Definition at line 261 of file baseai.h. References NLAIAGENT::IObjectIA::getStaticMember(), and NLAIAGENT::IObjectIA::getStaticMemberIndex().
00262 { 00263 return getStaticMember(getStaticMemberIndex(compName)); 00264 } |
|
to get the pointer of a given components referened by an index. Reimplemented from NLAIAGENT::IObjectIA. Definition at line 547 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, index, and sint32. Referenced by NLAIAGENT::CAgentScript::sendMessage().
00548 { 00549 #ifdef NL_DEBUG 00550 if ( index >= _NbComponents ) 00551 { 00552 throw NLAIE::CExceptionIndexError(); 00553 } 00554 #endif 00555 return _Components[ index ]; 00556 } |
|
to get the index of a given components name. Reimplemented from NLAIAGENT::IObjectIA. Definition at line 2319 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAISCRIPT::CAgentClass::getInheritedStaticMemberIndex(), and sint32. Referenced by NLAIAGENT::CAgentScript::runInitComponent(), NLAIAGENT::CAgentScript::runTellSetValue(), and NLAIAGENT::CAgentScript::sendMessage().
02320 { 02321 return _AgentClass->getInheritedStaticMemberIndex(name); 02322 } |
|
Static member is the component that the agent is create and die with. getStaticMemberSize to get the size of the static member components Reimplemented from NLAIAGENT::IObjectIA. Definition at line 542 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_NbComponents, and sint32.
00543 { 00544 return _NbComponents;//_AgentClass->getStaticMemberSize(); 00545 } |
|
Definition at line 429 of file agent_script.h.
00430 {
00431 return NULL;
00432 }
|
|
Definition at line 948 of file actor_script.cpp. References _TopLevel. Referenced by runMethodBase().
00949 { 00950 return _TopLevel; 00951 } |
|
getType return a unique string how represente the class, it can be the name of the class. This function is used for the sytem regstry class (see the definition of the template class Gen::CRegistry). Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 426 of file actor_script.cpp. References IdActorScript. Referenced by processFailure(), and processSuccess().
00427 { 00428 return IdActorScript; 00429 } |
|
allow to know if the agent have an activity process to run.
Reimplemented from NLAIAGENT::IAgent. Reimplemented in NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CAgentOperation. Definition at line 1617 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, and NLAISCRIPT::CAgentClass::getRunMethod(). Referenced by NLAIAGENT::CMainAgentScript::run().
01618 { 01619 return _AgentClass != NULL && (_AgentClass->getRunMethod() >= 0); 01620 } |
|
|
Init method alows to init the attribut of an object. the maparmetre is in more time a list of IObjectIA. Reimplemented in NLAIFUZZY::CSimpleFuzzyCond, NLAIFUZZY::CFuzzyRule, NLAIFUZZY::CFuzzyRuleSet, NLAIFUZZY::CFuzzyInterval, NLAIFUZZY::CRightFuzzySet, NLAIFUZZY::CTriangleFuzzySet, NLAIFUZZY::CTrapezeFuzzySet, NLAIFUZZY::CLeftFuzzySet, NLAIFUZZY::CFuzzyVar, NLAILOGIC::CFirstOrderAssert, NLAILOGIC::CRule, and NLAILOGIC::CFactPattern. Definition at line 116 of file baseai.cpp. Referenced by NLAIFUZZY::IFuzzySet::runMethodeMember(), and NLAISCRIPT::CLdbNewOpCode::runOpCode().
00117 { 00118 00119 } |
|
Definition at line 92 of file agent_script.cpp. References _ADD_SET_, _ADDCHILD_, _FATHER_, _GETCHILD_, _GETNAME_, _ISA_, _REMOVECHILD_, _RUNASK_, _RUNTEL_, _SELF_, _SEND_, _SETSTATIC_, NLAILINK::buildScript(), NLAIAGENT::CAgentScript::IdMsgNotifyParent, NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass, NLAIAGENT::CAgentScript::IdMsgNotifyParentClass, NLAIC::IPointerGestion::incRef(), NLAIAGENT::CAgentScript::msgPerf, NLAIAGENT::CAgentScript::msgType, NLAIAGENT::CAgentScript::ParamGetValueMsg, NLAIAGENT::CAgentScript::ParamIdGetValueMsg, NLAIAGENT::CAgentScript::ParamIdInitComponentMsg, NLAIAGENT::CAgentScript::ParamIdSetValueMsg, NLAIAGENT::CAgentScript::ParamInitComponentMsg, NLAIAGENT::CAgentScript::ParamRunParentNotify, NLAIAGENT::CAgentScript::ParamSetValueMsg, NLAIAGENT::CAgentScript::ParamTellComponentMsg, NLAIAGENT::CAgentScript::SendCompParamMessageScript, and NLAIAGENT::CAgentScript::SendParamMessageScript. Referenced by NLAILINK::initIALib().
00093 { 00094 00095 std::string msgStr; 00096 std::string scriptName("MsgAgentScript"); 00097 msgStr = std::string("From Message : Define MsgTellComponent\n{"); 00098 msgStr += std::string("Component:\n"); 00099 msgStr += std::string("\tString<'CompomentName'>;\n"); 00100 msgStr += std::string("\tMessage<'MsgType'>;\n"); 00101 msgStr += std::string("End\n"); 00102 00103 00104 msgStr += std::string("Constructor(String i; Message msg)\n"); 00105 msgStr += std::string("\tCompomentName = i;\n"); 00106 msgStr += std::string("\tMsgType = msg;\n"); 00107 msgStr += std::string("End\n"); 00108 msgStr += std::string("}\n"); 00109 //NLAILINK::buildScript(msgStr,scriptName); 00110 00111 msgStr += std::string("From Message : Define MsgInitCompoment\n{"); 00112 msgStr += std::string("Component:\n"); 00113 msgStr += std::string("End\n}\n"); 00114 00115 msgStr += std::string("From Message : Define MsgDebugString\n{"); 00116 msgStr += std::string("Component:\n"); 00117 msgStr += std::string("End\n}\n"); 00118 00119 00120 NLAILINK::buildScript(msgStr,scriptName); 00121 00122 static NLAIC::CIdentType idMsgTellComponentType ("MsgTellComponent"); 00123 static NLAIC::CIdentType idMsgInitComponentType ("MsgInitCompoment"); 00124 static NLAIC::CIdentType idMsgDebugString ("MsgDebugString"); 00125 00126 msgType = new NLAISCRIPT::COperandSimpleListOr(3, 00127 new NLAIC::CIdentType(CMessageList::IdMessage), 00128 new NLAIC::CIdentType(CMessageVector::IdMessageVector), 00129 new NLAIC::CIdentType(NLAISCRIPT::CMessageClass::IdMessageClass)); 00130 00131 msgPerf = new NLAISCRIPT::COperandSimpleListOr(7, 00132 new NLAIC::CIdentType(CPExec::IdPExec), 00133 new NLAIC::CIdentType(CPAchieve::IdPAchieve), 00134 new NLAIC::CIdentType(CPAsk::IdPAsk), 00135 new NLAIC::CIdentType(CPBreak::IdPBreak), 00136 new NLAIC::CIdentType(CPTell::IdPTell), 00137 new NLAIC::CIdentType(CPKill::IdPKill), 00138 new NLAIC::CIdentType(CPError::IdPError)); 00139 00140 00141 SendParamMessageScript = new NLAISCRIPT::CParam(2,msgPerf, msgType); 00142 00143 msgPerf->incRef(); 00144 msgType->incRef(); 00145 00146 SendCompParamMessageScript = new NLAISCRIPT::CParam(3,new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(CStringType::IdStringType)), 00147 msgPerf, msgType); 00148 00149 IdMsgNotifyParentClass = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass)); 00150 00151 IdMsgNotifyParent = new NLAISCRIPT::COperandSimpleListOr(2, 00152 new NLAIC::CIdentType(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass), 00153 new NLAIC::CIdentType(CNotifyParentScript::IdNotifyParentScript)); 00154 00155 ParamRunParentNotify = new NLAISCRIPT::CParam(1,IdMsgNotifyParent); 00156 00157 NLAISCRIPT::COperandSimple *idMsgTellComponent = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(idMsgTellComponentType)); 00158 NLAISCRIPT::CParam *ParamTellComponentMsg = new NLAISCRIPT::CParam(1,idMsgTellComponent); 00159 00160 NLAISCRIPT::COperandSimple *idOpMsgDebugString = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(idMsgDebugString)); 00161 NLAISCRIPT::CParam *ParamMsgDebugString = new NLAISCRIPT::CParam(1,idOpMsgDebugString); 00162 00163 CAgentScript::ParamIdGetValueMsg = new NLAISCRIPT::COperandSimpleListOr(2, 00164 new NLAIC::CIdentType(NLAIAGENT::CGetValueMsg::IdGetValueMsg), 00165 new NLAIC::CIdentType(NLAISCRIPT::CGetValueMsgClass::IdGetValueMsgClass) ); 00166 00167 CAgentScript::ParamGetValueMsg = new NLAISCRIPT::CParam(1,ParamIdGetValueMsg); 00168 00169 CAgentScript::ParamIdSetValueMsg = new NLAISCRIPT::COperandSimpleListOr(2, 00170 new NLAIC::CIdentType(NLAIAGENT::CSetValueMsg::IdSetValueMsg), 00171 new NLAIC::CIdentType(NLAISCRIPT::CSetValueMsgClass::IdSetValueMsgClass) ); 00172 00173 CAgentScript::ParamSetValueMsg = new NLAISCRIPT::CParam(1,ParamIdSetValueMsg); 00174 00176 CAgentScript::ParamIdInitComponentMsg = new NLAISCRIPT::COperandSimpleListOr(2, 00177 new NLAIC::CIdentType(idMsgInitComponentType), 00178 new NLAIC::CIdentType(idMsgInitComponentType) ); 00179 00180 CAgentScript::ParamInitComponentMsg = new NLAISCRIPT::CParam(1,ParamIdInitComponentMsg); 00182 00183 StaticMethod = new CAgentScript::CMethodCall *[CAgentScript::TLastM]; 00184 00185 StaticMethod[CAgentScript::TRunAskParentNotify] = new CAgentScript::CMethodCall( _RUNASK_, 00186 CAgentScript::TRunAskParentNotify, ParamRunParentNotify, 00187 CAgentScript::CheckAll, 00188 1, 00189 new NLAISCRIPT::CObjectUnknown(IdMsgNotifyParentClass)); 00190 00191 IdMsgNotifyParentClass->incRef(); 00192 ParamRunParentNotify->incRef(); 00193 StaticMethod[CAgentScript::TRunTellParentNotify] = new CAgentScript::CMethodCall( _RUNTEL_, 00194 CAgentScript::TRunTellParentNotify, ParamRunParentNotify, 00195 CAgentScript::CheckAll, 00196 1, 00197 new NLAISCRIPT::CObjectUnknown(IdMsgNotifyParentClass)); 00198 00199 idMsgTellComponent->incRef(); 00200 StaticMethod[CAgentScript::TRunTellComponent] = new CAgentScript::CMethodCall( _RUNTEL_, 00201 CAgentScript::TRunTellComponent, ParamTellComponentMsg, 00202 CAgentScript::CheckAll, 00203 1, 00204 new NLAISCRIPT::CObjectUnknown(idMsgTellComponent)); 00205 00206 idOpMsgDebugString->incRef(); 00207 StaticMethod[CAgentScript::TRunAskDebugString] = new CAgentScript::CMethodCall( _RUNASK_, 00208 CAgentScript::TRunAskDebugString, ParamMsgDebugString, 00209 CAgentScript::CheckAll, 00210 1, 00211 new NLAISCRIPT::CObjectUnknown(idOpMsgDebugString)); 00212 00213 /*idOpMsgDebugString->incRef(); 00214 ParamMsgDebugString->incRef(); 00215 StaticMethod[CAgentScript::TRunAskDebugString] = new CAgentScript::CMethodCall( _RUNTEL_, 00216 CAgentScript::TRunTellComponent, ParamMsgDebugString, 00217 CAgentScript::CheckAll, 00218 1, 00219 new NLAISCRIPT::CObjectUnknown(idOpMsgDebugString));*/ 00220 00221 ParamTellComponentMsg->incRef(); 00222 idMsgTellComponent->incRef(); 00223 StaticMethod[CAgentScript::TRunAskComponent] = new CAgentScript::CMethodCall( _RUNASK_, 00224 CAgentScript::TRunAskComponent, ParamTellComponentMsg, 00225 CAgentScript::CheckAll, 00226 1, 00227 new NLAISCRIPT::CObjectUnknown(idMsgTellComponent)); 00228 00229 StaticMethod[CAgentScript::TSend] = new CAgentScript::CMethodCall( _SEND_, 00230 CAgentScript::TSend, SendParamMessageScript, 00231 CAgentScript::CheckAll, 00232 2, 00233 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)); 00234 00235 StaticMethod[CAgentScript::TSendComponent] = new CAgentScript::CMethodCall( _SEND_, 00236 CAgentScript::TSendComponent, 00237 SendCompParamMessageScript,CAgentScript::CheckAll, 00238 3, 00239 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)); 00240 00241 StaticMethod[CAgentScript::TGetChildTag] = new CAgentScript::CMethodCall( _GETCHILD_, 00242 CAgentScript::TGetChildTag, 00243 NULL, 00244 CAgentScript::CheckCount, 00245 1, 00246 new NLAISCRIPT::CObjectUnknown(new 00247 NLAISCRIPT::COperandSimple( 00248 new NLAIC::CIdentType(CVectorGroupManager::IdVectorGroupManager)))); 00249 00250 StaticMethod[CAgentScript::TAddChildTag] = new CAgentScript::CMethodCall( _ADDCHILD_, 00251 CAgentScript::TAddChildTag, 00252 NULL,CAgentScript::DoNotCheck, 00253 2, 00254 new NLAISCRIPT::CObjectUnknown( 00255 new NLAISCRIPT::COperandSimple( 00256 new NLAIC::CIdentType(DigitalType::IdDigitalType)))); 00257 00258 StaticMethod[CAgentScript::TFather] = new CAgentScript::CMethodCall( _FATHER_, 00259 CAgentScript::TFather, 00260 NULL,CAgentScript::CheckCount, 00261 0, 00262 new NLAISCRIPT::CObjectUnknown( 00263 new NLAISCRIPT::COperandSimple( 00264 //check if correct 00265 new NLAIC::CIdentType(*IAgent::IdAgent)))); 00266 00267 00268 StaticMethod[CAgentScript::TSelf] = new CAgentScript::CMethodCall( _SELF_, 00269 CAgentScript::TSelf, 00270 NULL,CAgentScript::CheckCount, 00271 0, 00272 new NLAISCRIPT::CObjectUnknown( new NLAISCRIPT::COperandSimple( 00273 new NLAIC::CIdentType(CAgentScript::IdAgentScript)))); 00274 00275 StaticMethod[CAgentScript::TGetName] = new CAgentScript::CMethodCall( _GETNAME_, 00276 CAgentScript::TGetName, 00277 NULL,CAgentScript::CheckCount, 00278 0, 00279 new NLAISCRIPT::CObjectUnknown( 00280 new NLAISCRIPT::COperandSimple( 00281 new NLAIC::CIdentType(CStringType::IdStringType)))); 00282 00283 StaticMethod[CAgentScript::TGetClassName] = new CAgentScript::CMethodCall( "GetClassName", 00284 CAgentScript::TGetClassName, 00285 NULL,CAgentScript::CheckCount, 00286 0, 00287 new NLAISCRIPT::CObjectUnknown( 00288 new NLAISCRIPT::COperandSimple( 00289 new NLAIC::CIdentType(CStringType::IdStringType)))); 00290 00291 StaticMethod[CAgentScript::TIsInherited] = new CAgentScript::CMethodCall( "IsInherited", 00292 CAgentScript::TIsInherited, 00293 NULL,CAgentScript::CheckCount, 00294 1, 00295 new NLAISCRIPT::CObjectUnknown( 00296 new NLAISCRIPT::COperandSimple( 00297 new NLAIC::CIdentType(NLAILOGIC::CBoolType::IdBoolType)))); 00298 00299 StaticMethod[CAgentScript::TRemoveChild] = new CAgentScript::CMethodCall( _REMOVECHILD_, 00300 CAgentScript::TRemoveChild, 00301 NULL,CAgentScript::CheckCount, 00302 0, 00303 new NLAISCRIPT::CObjectUnknown( 00304 new NLAISCRIPT::COperandSimple( 00305 new NLAIC::CIdentType(DigitalType::IdDigitalType)))); 00306 00307 StaticMethod[CAgentScript::TSetStatic] = new CAgentScript::CMethodCall( _SETSTATIC_, 00308 CAgentScript::TSetStatic, NULL, 00309 CAgentScript::CheckCount, 00310 2, 00311 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)) ; 00312 00313 00314 StaticMethod[CAgentScript::TGetValue] = new CAgentScript::CMethodCall( _RUNASK_, 00315 CAgentScript::TGetValue, ParamGetValueMsg, 00316 CAgentScript::CheckAll, 00317 1, 00318 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)) ; 00319 00320 StaticMethod[CAgentScript::TSetValue] = new CAgentScript::CMethodCall( _RUNTEL_, 00321 CAgentScript::TSetValue, ParamSetValueMsg, 00322 CAgentScript::CheckAll, 00323 1, 00324 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)) ; 00325 00326 ParamIdInitComponentMsg->incRef(); 00327 StaticMethod[CAgentScript::TInitComponent] = new CAgentScript::CMethodCall( _RUNTEL_, 00328 CAgentScript::TInitComponent, ParamInitComponentMsg, 00329 CAgentScript::CheckAll, 00330 1, 00331 new NLAISCRIPT::CObjectUnknown(ParamIdInitComponentMsg)) ; 00332 00333 NLAISCRIPT::CParam *ParamString = new NLAISCRIPT::CParam(1,new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(CStringType::IdStringType))); 00334 StaticMethod[CAgentScript::TIsEUU] = new CAgentScript::CMethodCall( _ISA_, 00335 CAgentScript::TIsEUU, 00336 ParamString,CAgentScript::CheckAll, 00337 0, new NLAISCRIPT::CObjectUnknown( new NLAISCRIPT::COperandSimple( 00338 new NLAIC::CIdentType(NLAIAGENT::UInt32Type::IdUInt32Type)))); 00339 ParamString->incRef(); 00340 StaticMethod[CAgentScript::TAddSet] = new CAgentScript::CMethodCall(_ADD_SET_, 00341 CAgentScript::TAddSet, 00342 ParamString,CAgentScript::CheckAll, 00343 0, new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)); 00344 00345 00346 StaticMethod[CAgentScript::TDeflautProccessMsg] = new CAgentScript::CMethodCall("DeflautProccessMsg", 00347 CAgentScript::TDeflautProccessMsg, NULL, 00348 CAgentScript::CheckCount, 00349 1, 00350 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)); 00351 00352 } |
|
Definition at line 50 of file actor_script.cpp. References ParamIdFailureMsg, and ParamIdSuccessMsg. Referenced by NLAILINK::initIALib().
00051 { 00052 CActorScript::ParamIdSuccessMsg = new NLAISCRIPT::COperandSimpleListOr(2, 00053 new NLAIC::CIdentType(NLAIAGENT::CSuccessMsg::IdSuccessMsg), 00054 new NLAIC::CIdentType(NLAISCRIPT::CSuccessMsgClass::IdSuccessMsgClass) ); 00055 CActorScript::ParamSuccessMsg = new NLAISCRIPT::CParam(1,ParamIdSuccessMsg); 00056 CActorScript::ParamIdFailureMsg = new NLAISCRIPT::COperandSimpleListOr(2, 00057 new NLAIC::CIdentType(NLAIAGENT::CFailureMsg::IdFailureMsg), 00058 new NLAIC::CIdentType(NLAISCRIPT::CFailureMsgClass::IdFailureMsgClass) ); 00059 00060 CActorScript::ParamFailureMsg = new NLAISCRIPT::CParam(1,ParamIdFailureMsg); 00061 } |
|
Test the set of the agent.
Definition at line 741 of file agent_script.cpp. References NLAIAGENT::CAgentScript::getType(), NLAIAGENT::CAgentScript::isClassInheritedFrom(), NLAIAGENT::CAgentScript::mapSet, and s. Referenced by NLAIAGENT::CAgentScript::runMethodBase().
00742 { 00743 std::set<std::string>::iterator it = mapSet.find(s); 00744 if(it != mapSet.end()) return true; 00745 else 00746 if(isClassInheritedFrom(CStringVarName(s.c_str())) >= 0) 00747 return true; 00748 else 00749 if(s == (const char *) getType()) 00750 return true; 00751 00752 return false; 00753 } |
|
Returns true if the actor has a token.
Definition at line 120 of file actor_script.cpp.
00121 { 00122 return _IsActivated; 00123 } |
|
isClassInheritedFrom(className) allow us to known if this class have a base class with the name className. If true the method return the range of the base class, this range is an arbitrary reference id define by the programmer or bay the scrypt. the false return is define by -1. Reimplemented in NLAIAGENT::IVector, NLAIAGENT::CLocalAgentMail, NLAIAGENT::INombreDefine, NLAIAGENT::IBaseGroupType, and NLAIAGENT::CMessageScript. Definition at line 246 of file baseai.cpp. References sint32. Referenced by NLAISCRIPT::CCompilateur::getValidateHierarchyBase(), NLAIAGENT::CLocalAgentMail::isClassInheritedFrom(), Launch(), NLAIAGENT::CFsmScript::setTopLevel(), and setTopLevel().
00247 {
00248 return -1;
00249 }
|
|
Definition at line 2314 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAISCRIPT::CAgentClass::isClassInheritedFrom(), and sint32. Referenced by NLAIAGENT::CAgentScript::isa(), and NLAIAGENT::CAgentScript::runMethodBase().
02315 { 02316 return _AgentClass->isClassInheritedFrom( name ); 02317 } |
|
Definition at line 2292 of file agent_script.cpp. References NLAIAGENT::IVarName::getString(), param, r, sint, NLAIAGENT::CAgentScript::TDeflautProccessMsg, and NLAIAGENT::TQueue. Referenced by NLAIAGENT::CAgentScript::isMember().
02293 { 02294 const char *name = methodName->getString(); 02295 if(name[0] == 'R' && name[1] == 'u' && name[2] == 'n') 02296 { 02297 static CStringVarName runMsgName[7] = {"RunTell", "RunAchieve", "RunAsk", "RunExec", "RunBreak", "RunKill", "RunError"}; 02298 sint i; 02299 for(i = 0; i < 7; i ++) 02300 { 02301 if(*methodName == runMsgName[i]) 02302 { 02303 TQueue r; 02304 CObjectType *c = new CObjectType(new NLAIC::CIdentType(NLAIC::CIdentType::VoidType)); 02305 r.push(CIdMethod(TDeflautProccessMsg + IAgent::getMethodIndexSize(),0.0,NULL,c)); 02306 return r; 02307 } 02308 } 02309 } 02310 02311 return TQueue(); 02312 } |
|
Implementation of the isEqual of the IBasicObjectIA.
Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript. Definition at line 385 of file actor_script.cpp.
00386 { 00387 return true; 00388 } |
|
If the result is true the object is loclal else its a representation of an object on the server. By the method return true.
Definition at line 356 of file baseai.cpp.
00357 { 00358 return true; 00359 } |
|
The method isMember(nameSubClass,methodName,param) return the best method correspondent to the search. remember we use the overloadind method. NameSubClass: if this pointer is not NULL then NameSubClass is the name of the base class were the method are defined. methodName: is the name of the class. param: is an IObjectIA where it defined the parametre of the method. lot of method use a IObjectIA vector object with an NLAIC::CIdentType as the the template argm. Reimplemented from NLAIAGENT::IObjectIA. Reimplemented in NLAIAGENT::CLocalAgentMail, and NLAIAGENT::CProxyAgentMail. Definition at line 452 of file agents.cpp. References NLAIAGENT::_GetNumId, NLAIAGENT::_RunAsk, NLAIAGENT::_RunTel, NLAISCRIPT::CParam::eval(), and NLAIAGENT::TQueue. Referenced by NLAIAGENT::CAgentScript::isMember(), NLAIAGENT::CLocalAgentMail::isMember(), and NLAIAGENT::CActor::isMember().
00453 { 00454 if(className == NULL) 00455 { 00456 TQueue a; 00457 for(int i = 0; i < _LastM; i++) 00458 { 00459 if(*methodName == IBasicAgent::_Method[i].MethodName) 00460 { 00461 CObjectType *c; 00462 if(i == _RunTel || i == _RunAsk) 00463 { 00464 static NLAISCRIPT::CParam paramMsg(1,new NLAISCRIPT::COperandSimple (new NLAIC::CIdentType(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass))); 00465 00466 if(paramMsg.eval((NLAISCRIPT::CParam &)p) < 0.0) continue; 00467 c = new CObjectType(new NLAIC::CIdentType(NLAISCRIPT::CMessageClass::IdMessageClass)); 00468 } 00469 else 00470 if (i == _GetNumId) 00471 { 00472 c = new CObjectType(new NLAIC::CIdentType(CStringType::IdStringType)); 00473 } 00474 else 00475 { 00476 c = new CObjectType(new NLAIC::CIdentType(CLocalAgentMail::LocalAgentMail)); 00477 } 00478 a.push(CIdMethod(IBasicAgent::_Method[i].Index + IObjectIA::getMethodIndexSize(),0.0,NULL,c)); 00479 break; 00480 } 00481 } 00482 00483 if(a.size()) return a; 00484 else return IConnectIA::isMember(className,methodName,p); 00485 } 00486 return IConnectIA::isMember(className,methodName,p); 00487 } |
|
Definition at line 2237 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAIAGENT::CAgentScript::getPrivateMember(), NLAISCRIPT::CAgentClass::getPrivateMember(), NLAIAGENT::CAgentScript::isDeflautProccessMsg(), NLAIAGENT::IBasicAgent::isMember(), param, r, and NLAIAGENT::TQueue. Referenced by NLAIAGENT::COperatorScript::getDebugString(), NLAIAGENT::CAgentScript::getDebugString(), NLAIAGENT::CAgentWatchTimer::isMember(), and NLAIAGENT::CAgentScript::sendMessage().
02238 { 02239 02240 02241 if(className == NULL) 02242 { 02243 02244 TQueue r; 02245 if(_AgentClass != NULL) 02246 r = _AgentClass->getPrivateMember(className,methodName,param); 02247 02248 if(r.size()) 02249 return r; 02250 else 02251 { 02252 r = getPrivateMember(className,methodName,param); 02253 if(r.size()) return r; 02254 else 02255 { 02256 r = IAgent::isMember(className,methodName,param); 02257 if(r.size()) 02258 return r; 02259 else 02260 return isDeflautProccessMsg(className,methodName,param); 02261 } 02262 } 02263 02264 } 02265 else 02266 if(*className == CStringVarName("Agent")) 02267 { 02268 TQueue r; 02269 r = getPrivateMember(className,methodName,param); 02270 if(r.size()) 02271 return r; 02272 else 02273 { 02274 r = _AgentClass->getPrivateMember(className,methodName,param); 02275 02276 if ( r.size() ) 02277 return r; 02278 else 02279 { 02280 r = IAgent::isMember(className,methodName,param); 02281 if(r.size()) 02282 return r; 02283 else 02284 return isDeflautProccessMsg(className,methodName,param); 02285 } 02286 } 02287 02288 } 02289 return TQueue(); 02290 } |
|
Call this function to destroy an agent including its referneces in other agents and its childs.
Reimplemented from NLAIAGENT::IConnectIA. Definition at line 57 of file agents.cpp. References NLAIAGENT::IConnectIA::onKill(), NLAIC::IPointerGestion::release(), and sint. Referenced by NLAIAGENT::CAgentScript::~CAgentScript(), NLAIAGENT::CMainAgentScript::~CMainAgentScript(), NLAIAGENT::IAgent::~IAgent(), and NLAIAGENT::IMainAgent::~IMainAgent().
00058 { 00059 //sint n = _SizeChild; 00060 00061 #ifdef NL_DEBUG 00062 if(_SizeChild != (sint)_AgentList.size()) 00063 { 00064 sint i = (sint)_AgentList.size(); 00065 throw; 00066 } 00067 00068 #endif 00069 sint n = _SizeChild ; 00070 while ( /*_AgentList.begin() != _AgentList.end()*/ n--) 00071 { 00072 IConnectIA *c = _AgentList.front(); 00073 _AgentList.pop_front(); 00074 c->onKill(this); 00075 c->release(); 00076 } 00077 _SizeChild = 0; 00078 IAgentComposite::Kill(); 00079 } |
|
Definition at line 609 of file actor_script.cpp. References _Launched, _NbAnswers, _TopLevel, NLAIAGENT::CAgentScript::addDynamicAgent(), and NLAIAGENT::IObjectIA::isClassInheritedFrom(). Referenced by runMethodBase().
00610 { 00611 00612 CStringType stringName( name.c_str() ); 00613 addDynamicAgent( stringName , child ); 00614 _NbAnswers++; 00615 00616 if ( child->isClassInheritedFrom( CStringVarName("Actor") ) != -1 ) 00617 { 00618 if ( _TopLevel ) 00619 ((CActorScript *)child)->setTopLevel( _TopLevel ); 00620 else 00621 ((CActorScript *)child)->setTopLevel( this ); 00622 00623 ((CActorScript *)child)->activate(); 00624 } 00625 00626 _Launched.push_back( (NLAIAGENT::IAgent *) child ); 00627 } |
|
Load the class from a stream. Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript. Definition at line 438 of file actor_script.cpp. References NLAIAGENT::CAgentScript::load(), NLMISC::IStream::serial(), and sint32.
00439 { 00440 CAgentScript::load(is); 00441 sint32 b; 00442 is.serial( b ); 00443 _IsActivated = !b ; 00444 } |
|
This function allow a new instance, that mean that the class is a class factory. Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 362 of file actor_script.cpp. References NLAISCRIPT::CAgentClass::buildNewInstance(), and CActorScript().
00363 { 00364 CActorScript *instance; 00365 if ( _AgentClass ) 00366 { 00367 instance = (CActorScript *) _AgentClass->buildNewInstance(); 00368 } 00369 else 00370 { 00371 instance = new CActorScript(NULL); 00372 } 00373 return instance; 00374 } |
|
Callback called at the activation of the actor.
Reimplemented in NLAILOGIC::CGoalPath. Definition at line 345 of file actor_script.cpp. Referenced by activate(), NLAIAGENT::COperatorScript::execOnActivate(), and runMethodBase().
00346 {
00347 // Default behaviour: do nothing
00348 }
|
|
Reimplemented in NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript. Definition at line 184 of file actor_script.h. Referenced by failure(), NLAIAGENT::CFsmScript::runMethodBase(), and runMethodBase().
00184 {} |
|
Called by an agent who's destroyed te remove its references.
Reimplemented from NLAIAGENT::IAgent. Reimplemented in NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentOperation, and NLAIAGENT::COperatorScript. Definition at line 725 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, and NLAIAGENT::IAgent::onKill(). Referenced by NLAIAGENT::CAgentWatchTimer::onKill().
00726 { 00727 TSetDefNameAgent::iterator iter = _DynamicAgentName.begin(); 00728 while( iter != _DynamicAgentName.end() ) 00729 { 00730 if((*(*iter).Itr) == a) 00731 { 00732 _DynamicAgentName.erase(iter); 00733 break; 00734 } 00735 iter++; 00736 } 00737 IAgent::onKill(a); 00738 } |
|
These functions can be overloaded to have the actor execute something when paused or restarted.
Definition at line 237 of file actor_script.cpp. Referenced by pause().
00238 {
00239 // Default: doesn't do anything.
00240 }
|
|
Definition at line 288 of file actor_script.cpp. Referenced by restart().
00289 { 00290 } |
|
Dependencies failure and success notification These functions are called by other operators or goals who failed or succeeded Reimplemented in NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript. Definition at line 183 of file actor_script.h. Referenced by NLAIAGENT::CFsmScript::runMethodBase(), runMethodBase(), and success().
00183 {} |
|
Callback called when the agent is unactivated.
Reimplemented in NLAILOGIC::CGoalPath. Definition at line 351 of file actor_script.cpp. Referenced by runMethodBase(), and unActivate().
00352 {
00353 // default behaviour: do nothing
00354 }
|
|
to get a word num ref of the agents.
Definition at line 380 of file baseai.cpp. References NLAIAGENT::IRefrence::_NumRef.
00381 {
00382 return *_NumRef;
00383 }
|
|
to get a word num ref pointer of the agents.
Definition at line 385 of file baseai.cpp. References NLAIAGENT::IRefrence::_NumRef.
00386 {
00387 return _NumRef;
00388 }
|
|
Lot of algo use this function to determine the equality between 2 class, in particular the extraction from stl list. the == operator call the bool isEqual(const IBasicObjectIA &a) const member method to determine the equality between tow class. Definition at line 134 of file baseai.cpp. References NLAIC::IBasicType::getType(), and NLAIAGENT::IBasicObjectIA::isEqual().
|
|
Pauses the actor.
Definition at line 191 of file actor_script.cpp. References _IsPaused, _Launched, _OnPauseIndex, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::CAgentScript::getAgentManager(), NLAIC::IBasicType::getType(), NLAISCRIPT::CAgentClass::isMember(), onPause(), r, NLAIAGENT::CAgentScript::runMethodeMember(), NLAISCRIPT::CCodeContext::Self, and NLAIAGENT::TQueue. Referenced by NLAIAGENT::COperatorScript::checkPause(), and runMethodBase().
00192 { 00193 if ( _IsActivated ) 00194 { 00195 00196 if ( !_IsPaused ) 00197 { 00198 // Looks for the function to call when the actor is paused 00199 static CStringVarName activate_func_name("OnPause"); 00200 TQueue r = _AgentClass->isMember( NULL, &activate_func_name, NLAISCRIPT::CParam() ); 00201 if ( !r.empty() ) 00202 { 00203 if ( getAgentManager() != NULL ) 00204 { 00205 _OnPauseIndex = r.top().Index; 00206 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *) getAgentManager()->getAgentContext(); 00207 context->Self = this; 00208 runMethodeMember( _OnPauseIndex ,context); 00209 _OnPauseIndex = -1; 00210 } 00211 } 00212 else 00213 onPause(); 00214 _IsPaused = true; 00215 } 00216 00217 // Calls the launched actors Pause callbacks 00218 std::list<IBasicAgent *>::iterator it_l = _Launched.begin(); 00219 while ( it_l != _Launched.end() ) 00220 { 00221 CActorScript *launched = (CActorScript *) *it_l; 00222 launched->pause(); 00223 it_l++; 00224 } 00225 00226 int i; 00227 for ( i = 0; i < _NbComponents; i++ ) 00228 { 00229 if ( ((const NLAIC::CTypeOfObject &)_Components[i]->getType()) & NLAIC::CTypeOfObject::tActor ) 00230 { 00231 ( (CActorScript *) _Components[i] )->pause(); 00232 } 00233 } 00234 } 00235 } |
|
Priority of the operator.
Reimplemented in NLAIAGENT::COperatorScript. Definition at line 926 of file actor_script.cpp.
00927 { 00928 // Look at predecessors priorities 00929 return 1.0; 00930 } |
|
Definition at line 1461 of file agent_script.cpp. References NLAIC::IBasicType::clone(), NLAIAGENT::IMessageBase::getContinuation(), NLAIAGENT::IMessageBase::getPerformatif(), NLAIAGENT::IMessageBase::getSender(), NLAIAGENT::IMessageBase::setMethodIndex(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setReceiver(), and NLAIAGENT::IMessageBase::setSender(). Referenced by NLAIAGENT::CAgentScript::processMessages().
01462 { 01463 switch(msg->getPerformatif()) 01464 { 01465 case IMessageBase::PExec: 01466 if(msg->getContinuation() != NULL) 01467 { 01468 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01469 o->setMethodIndex(-1,-1); 01470 //this->incRef(); 01471 o->setSender(this); 01472 //((IObjectIA *)msg->getContinuation())->incRef(); 01473 o->setReceiver((IObjectIA *)msg->getContinuation()); 01474 ((IObjectIA *)msg->getContinuation())->sendMessage(o); 01475 } 01476 break; 01477 case IMessageBase::PAchieve: 01478 if(msg->getContinuation() != NULL) 01479 { 01480 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01481 o->setMethodIndex(-1,-1); 01482 //this->incRef(); 01483 o->setSender(this); 01484 //((IObjectIA *)msg->getContinuation())->incRef(); 01485 o->setReceiver((IObjectIA *)msg->getContinuation()); 01486 ((IObjectIA *)msg->getContinuation())->sendMessage(o); 01487 } 01488 break; 01489 case IMessageBase::PAsk: 01490 { 01491 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01492 o->setMethodIndex(-1,-1); 01493 //this->incRef(); 01494 o->setSender(this); 01495 o->setPerformatif(IMessageBase::PTell); 01496 //if(returnMsg->getSender() != NULL) ((IObjectIA *)returnMsg->getSender())->incRef(); 01497 o->setReceiver((IObjectIA *)returnMsg->getSender()); 01498 ((IObjectIA *)msg->getSender())->sendMessage(o); 01499 01500 01501 if(msg->getContinuation() != NULL) 01502 { 01503 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01504 o->setMethodIndex(-1,-1); 01505 //this->incRef(); 01506 o->setSender(this); 01507 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef(); 01508 o->setReceiver((IObjectIA *)msg->getContinuation()); 01509 o->setPerformatif(IMessageBase::PTell); 01510 ((IObjectIA *)msg->getContinuation())->sendMessage(o); 01511 } 01512 } 01513 break; 01514 case IMessageBase::PTell: 01515 if(msg->getContinuation() != NULL) 01516 { 01517 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01518 o->setMethodIndex(-1,-1); 01519 //this->incRef(); 01520 o->setSender(this); 01521 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef(); 01522 o->setReceiver((IObjectIA *)msg->getContinuation()); 01523 ((IObjectIA *)msg->getContinuation())->sendMessage(o); 01524 } 01525 break; 01526 case IMessageBase::PBreak: 01527 if(msg->getContinuation() != NULL) 01528 { 01529 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01530 o->setMethodIndex(-1,-1); 01531 //this->incRef(); 01532 o->setSender(this); 01533 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef(); 01534 o->setReceiver((IObjectIA *)msg->getContinuation()); 01535 ((IObjectIA *)msg->getContinuation())->sendMessage(o); 01536 } 01537 break; 01538 case IMessageBase::PKill: 01539 if(msg->getContinuation() != NULL) 01540 { 01541 IMessageBase *o = (IMessageBase *)returnMsg->clone(); 01542 o->setMethodIndex(-1,-1); 01543 //this->incRef(); 01544 o->setSender(this); 01545 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef(); 01546 o->setReceiver((IObjectIA *)msg->getContinuation()); 01547 ((IObjectIA *)msg->getContinuation())->sendMessage(o); 01548 } 01549 break; 01550 default: break; 01551 } 01552 } |
|
Definition at line 1004 of file actor_script.cpp. References failure(), getType(), and param. Referenced by runMethodBase().
|
|
Reimplemented in NLAIAGENT::COperatorScript. Definition at line 1412 of file agent_script.cpp. References NLAISCRIPT::CCodeContext::ContextDebug, NLAIAGENT::CAgentScript::getBaseMethodCount(), NLAIAGENT::IMessageBase::getHeritanceIndex(), NLAIAGENT::IBasicAgent::getMail(), NLAIAGENT::CAgentScript::getMethode(), NLAIAGENT::IMessageBase::getMethodIndex(), NLAIC::IBasicType::getType(), NLAIC::IPointerGestion::incRef(), param, NLAIAGENT::IMailBox::popMessage(), NLAIAGENT::CAgentScript::processContinuation(), NLAIC::IPointerGestion::release(), NLAISCRIPT::CCallMethod::runOpCode(), NLAISCRIPT::CCodeContext::Self, and NLAISCRIPT::CCodeContext::Stack.
01413 { 01414 #ifdef NL_DEBUG 01415 const char *txt = (const char *)msg->getType(); 01416 bool dbugB = false; 01417 #endif 01418 NLAISCRIPT::CCodeContext &context = (NLAISCRIPT::CCodeContext &)*c; 01419 IBaseGroupType *param = new CGroupType(); 01420 msg->incRef(); 01421 param->push(msg); 01422 context.Stack ++; 01423 context.Stack[(int)context.Stack] = param; 01424 01425 int indexM = msg->getMethodIndex() - getBaseMethodCount(); 01426 if(indexM >= 0) 01427 { 01428 IObjectIA *code = getMethode(indexM); 01429 if(code == NULL) 01430 { 01431 getMail()->popMessage(); 01432 return; 01433 } 01434 } 01435 01436 NLAISCRIPT::IMethodContext *methodContex; 01437 01438 if (context.ContextDebug.Active) 01439 { 01440 /*context.ContextDebug.Param.push_back(&listBidon); 01441 listBidon.incRef();*/ 01442 methodContex = new NLAISCRIPT::CMethodContextDebug(); 01443 } 01444 else 01445 { 01446 methodContex = new NLAISCRIPT::CMethodContext(); 01447 } 01448 const IObjectIA *self = context.Self; 01449 context.Self = this; 01450 NLAISCRIPT::CCallMethod opCall(methodContex,msg->getHeritanceIndex(),msg->getMethodIndex()); 01451 opCall.runOpCode(context); 01452 context.Self = self; 01453 IMessageBase *returnMsg = (IMessageBase *)context.Stack[(int)context.Stack]; 01454 returnMsg->incRef(); 01455 context.Stack--; 01456 processContinuation(msg, returnMsg); 01457 01458 returnMsg->release(); 01459 } |
|
The processMessages method, process the loop/Run message. Reimplemented from NLAIAGENT::CAgentScript. Definition at line 395 of file actor_script.cpp. References NLAIAGENT::CAgentScript::processMessages(). Referenced by run().
00396 {
00397 //if ( _IsActivated )
00398 CAgentScript::processMessages();
00399 }
|
|
Own success and failure functions These function telle other operators and goals that might be waiting for the execution of this one. Definition at line 953 of file actor_script.cpp. References getType(), param, and success(). Referenced by runMethodBase(), and runTell().
|
|
the loader of the class.
Definition at line 433 of file baseai.cpp. References NLAIAGENT::IRefrence::_NumRef, NLAIC::IBasicInterface::load(), NLAIC::IPointerGestion::release(), and NLMISC::IStream::serial(). Referenced by NLAIAGENT::IRefrence::IRefrence(), and NLAIAGENT::IRefrence::load().
00434 { 00435 IObjectIA::load(is); 00436 _NumRef->release(); 00437 NLAIC::CIdentTypeAlloc id; 00438 is >> id; 00439 _NumRef = (IWordNumRef *)id.allocClass(); 00440 _NumRef->load(is); 00441 bool k; 00442 is.serial( k ); 00443 if ( k ) 00444 { 00445 if(_Parent) _Parent->release(); 00446 is >> id; 00447 _Parent = (IWordNumRef *)id.allocClass(); 00448 _Parent->load(is); 00449 } 00450 else 00451 { 00452 _Parent = NULL; 00453 } 00454 } |
|
|
Definition at line 355 of file agent_script.cpp. References sint. Referenced by NLAILINK::releaseIALib().
00356 { 00357 //SendParamMessageScript->release(); 00358 //IdMsgNotifyParentClass->release(); 00360 // Temp, to be transfered in CGDAgentScript (Goal Driven Agent) 00361 // IdGoalMsgClass->release(); 00362 // IdGoalMsg->release(); 00363 //ParamGoalMsg->release(); 00364 //ParamCancelGoalMsg->release(); 00366 00367 //ParamRunParentNotify->release(); 00368 //SendCompParamMessageScript->release(); 00369 sint i; 00370 for(i = 0; i < CAgentScript::TLastM; i++) 00371 { 00372 delete StaticMethod[i]; 00373 } 00374 delete StaticMethod; 00375 } |
|
Definition at line 63 of file actor_script.cpp. Referenced by NLAILINK::releaseIALib().
00064 { 00065 CActorScript::ParamSuccessMsg->release(); 00066 CActorScript::ParamFailureMsg->release(); 00067 } |
|
Removing operator from th agent.
Definition at line 1672 of file agent_script.cpp.
01673 { 01674 /* std::vector<NLAILOGIC::IBaseOperator *>::iterator it_o = _Operators.begin(); 01675 while ( it_o != _Operators.end() ) 01676 { 01677 if ( op == *it_o ) 01678 { 01679 _Operators.erase( it_o ); 01680 return; 01681 } 01682 it_o++; 01683 } 01684 char buf[2048]; 01685 op->getDebugString(buf); 01686 throw NLAIE::CExceptionObjectNotFoundError(buf); 01687 */ 01688 } |
|
Remove a child from the std::list<IBasicAgent *> child list. Implements NLAIAGENT::IBasicAgent. Reimplemented in NLAIAGENT::CLocalAgentMail. Definition at line 84 of file basic_agent.cpp. References NLAIAGENT::IAgentComposite::_AgentList, and NLAIAGENT::IAgentComposite::_SizeChild.
00085 { 00086 _AgentList.erase(iter); 00087 _SizeChild --; 00088 } |
|
Remove a child from the std::list<IBasicAgent *> child list. Implements NLAIAGENT::IBasicAgent. Reimplemented in NLAIAGENT::CLocalAgentMail. Definition at line 108 of file basic_agent.cpp. References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, NLAIAGENT::IBasicAgent::getMail(), NLAIC::IPointerGestion::release(), and NLAIAGENT::IMailBox::removeMailBox().
00109 { 00110 std::list<IBasicAgent *>::iterator i = _AgentList.begin(); 00111 while(i != _AgentList.end()) 00112 { 00113 IBasicAgent *c = *i; 00114 if(c == p) 00115 { 00116 _AgentList.erase(i); 00117 p->getMail()->removeMailBox( this->getMail() ); 00118 c->release(); 00119 _SizeChild --; 00120 // Supprime chez l'ancien fils la boite au lettre du père 00121 break; 00122 } 00123 i++; 00124 } 00125 } |
|
Definition at line 90 of file basic_agent.cpp. References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, NLAIAGENT::IBasicAgent::getMail(), and NLAIAGENT::IMailBox::removeMailBox(). Referenced by NLAIAGENT::CAgentScript::removeDynamic(), NLAIAGENT::IAgent::runChildren(), and NLAIAGENT::IAgent::runChildrenStepByStep().
00091 { 00092 std::list<IBasicAgent *>::iterator i = _AgentList.begin(); 00093 while(i != _AgentList.end()) 00094 { 00095 if(*((*i)) == p) 00096 { 00097 (*i)->release(); 00098 _AgentList.erase(i); 00099 // Supprime chez l'ancien fils la boite au lettre du père 00100 p.getMail()->removeMailBox( this->getMail() ); 00101 _SizeChild --; 00102 return; 00103 } 00104 i++; 00105 } 00106 } |
|
To release a connection.
Definition at line 561 of file baseai.cpp. References NLAIAGENT::IConnectIA::removeInConnectedList(), and NLAIAGENT::IConnectIA::removeInConnectionList(). Referenced by NLAIAGENT::CAgentWatchTimer::detach(), NLAIAGENT::IAgent::onKill(), NLAIAGENT::IAgentInput::releaseInputConnexion(), and NLAIAGENT::CLocalMailBox::removeMailBox().
00562 { 00563 Agent->removeInConnectedList(this); 00564 removeInConnectionList(Agent); 00565 } |
|
that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g); Definition at line 840 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIAGENT::IBaseGroupType::getFront(), r, NLAIAGENT::IAgentComposite::removeChild(), and s.
00841 { 00842 CStringType *s = (CStringType *)g->getFront(); 00843 IObjectIA::CProcessResult r; 00844 r.ResultState = IObjectIA::ProcessIdle; 00845 std::pair<TSetDefNameAgent::iterator,TSetDefNameAgent::iterator> p = _DynamicAgentName.equal_range(CKeyAgent(*s)); 00846 00847 if(p.first != p.second) 00848 { 00849 while(p.first != p.second) 00850 { 00851 TSetDefNameAgent::iterator iTmp = p.first; 00852 p.first ++; 00853 00854 NLAIAGENT::IBasicAgent *o = *iTmp->Itr; 00855 _DynamicAgentName.erase(iTmp); 00856 removeChild(o); 00857 } 00858 r.Result = new DigitalType(1.0); 00859 return r; 00860 } 00861 r.Result = &DigitalType::NullOperator; 00862 r.Result->incRef(); 00863 return r; 00864 } |
|
remove an agent from the manager. The rgument g must store an CStringType. This string is the name of the agent to remove. The methode return the state of the operation, an digital at 1.0 if the remove is done an digital at 0.0 is the method did'nt find the agent. Definition at line 867 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, and NLAIAGENT::IAgentComposite::removeChild(). Referenced by NLAIAGENT::CAgentScript::runMethodBase(), and unActivate().
00868 { 00869 00870 TSetDefNameAgent::iterator p = _DynamicAgentName.begin(); 00871 00872 while(p != _DynamicAgentName.end()) 00873 { 00874 if((*(*p).Itr) == ag) 00875 { 00876 _DynamicAgentName.erase(p); 00877 removeChild(ag); 00878 break; 00879 } 00880 p ++; 00881 } 00882 } |
|
remove a goal, it hapend when it neaded by user, when the priorty is down or when the goal is satisfay.
Definition at line 410 of file agent_script.h. Referenced by NLAILOGIC::CGoal::operatorSuccess().
00411 { 00412 } |
|
Definition at line 600 of file baseai.cpp. References NLAIAGENT::IConnectIA::_Connected, and NLAIAGENT::IConnectIA::TListIBasicItr. Referenced by NLAIAGENT::IConnectIA::Kill(), and NLAIAGENT::IConnectIA::removeConnection().
00601 { 00602 TListIBasicItr i = _Connected.find(a); 00603 if(i != _Connected.end()) 00604 _Connected.erase(i); 00605 /*TListIBasicItr i = _Connected.begin(); 00606 while(i != _Connected.end()) 00607 { 00608 const IConnectIA *o = *i; 00609 if(o == a) 00610 { 00611 _Connected.erase(i); 00612 return; 00613 } 00614 i++; 00615 }*/ 00616 } |
|
Definition at line 577 of file baseai.cpp. References NLAIAGENT::IConnectIA::_Connection, and NLAIAGENT::IConnectIA::TListIBasicItr. Referenced by NLAIAGENT::IConnectIA::Kill(), and NLAIAGENT::IConnectIA::removeConnection().
00578 { 00579 00580 TListIBasicItr i = _Connection.find(a); 00581 if(i != _Connection.end()) 00582 _Connection.erase(i); 00583 /*TListIBasicItr i = _Connection.begin(); 00584 while(i != _Connection.end()) 00585 { 00586 if(*i == a) 00587 { 00588 _Connection.erase(i); 00589 return; 00590 } 00591 i++; 00592 }*/ 00593 } |
|
Restarts the actor.
Definition at line 243 of file actor_script.cpp. References _IsPaused, _Launched, _OnRestartIndex, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::CAgentScript::getAgentManager(), NLAIC::IBasicType::getType(), NLAISCRIPT::CAgentClass::isMember(), onRestart(), r, NLAIAGENT::CAgentScript::runMethodeMember(), NLAISCRIPT::CCodeContext::Self, and NLAIAGENT::TQueue. Referenced by NLAIAGENT::COperatorScript::checkPause(), and runMethodBase().
00244 { 00245 if ( _IsActivated ) 00246 { 00247 if ( _IsPaused ) 00248 { 00249 // Looks for the function to call when the actor is restarted 00250 static CStringVarName activate_func_name("OnRestart"); 00251 TQueue r = _AgentClass->isMember( NULL, &activate_func_name, NLAISCRIPT::CParam() ); 00252 if ( !r.empty() ) 00253 { 00254 if ( getAgentManager() != NULL ) 00255 { 00256 _OnRestartIndex = r.top().Index; 00257 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *) getAgentManager()->getAgentContext(); 00258 context->Self = this; 00259 runMethodeMember( _OnRestartIndex ,context); 00260 _OnRestartIndex = -1; 00261 } 00262 } 00263 else 00264 onRestart(); 00265 _IsPaused = false; 00266 } 00267 00268 // Calls the launched actors Restart callbacks 00269 std::list<IBasicAgent *>::iterator it_l = _Launched.begin(); 00270 while ( it_l != _Launched.end() ) 00271 { 00272 CActorScript *launched = (CActorScript *) *it_l; 00273 launched->restart(); 00274 it_l++; 00275 } 00276 00277 int i; 00278 for ( i = 0; i < _NbComponents; i++ ) 00279 { 00280 if ( ((const NLAIC::CTypeOfObject &)_Components[i]->getType()) & NLAIC::CTypeOfObject::tActor ) 00281 { 00282 ( (CActorScript *) _Components[i] )->restart(); 00283 } 00284 } 00285 } 00286 } |
|
Run message is the message processing. Reimplemented in NLAIAGENT::CMsgWaiter. Definition at line 365 of file agents.cpp. References NLAIAGENT::IMessageBase::getContinuation(), NLAIAGENT::IMessageBase::getPerformatif(), NLAIAGENT::IMessageBase::getSender(), NLAIC::IBasicType::getType(), NLAIC::IPointerGestion::incRef(), NLAIC::IPointerGestion::release(), NLAIAGENT::IBasicAgent::runAchieve(), NLAIAGENT::IBasicAgent::runAsk(), NLAIAGENT::IBasicAgent::runBreak(), NLAIAGENT::IBasicAgent::runError(), NLAIAGENT::IBasicAgent::runEven(), NLAIAGENT::IBasicAgent::runExec(), NLAIAGENT::IBasicAgent::runKill(), NLAIAGENT::IBasicAgent::runTell(), NLAIAGENT::IMessageBase::setPerformatif(), and NLAIC::stringGetBuild(). Referenced by NLAIAGENT::CSeqFsmScript::runChildren(), and NLAIAGENT::IAgent::runChildren().
00366 { 00367 IMessageBase *returnMsg = NULL; 00368 switch(msg.getPerformatif()) 00369 { 00370 case IMessageBase::PUndefine: 00371 { 00372 std::string text; 00373 text = NLAIC::stringGetBuild("Function IObjectIA *IBasicAgent::run('%s') proccess an IMessageBase::PUndefine performatif",(const char *)msg.getType()); 00374 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00375 } 00376 break; 00377 case IMessageBase::PExec: 00378 00379 returnMsg = runExec(msg); 00380 if(msg.getContinuation() != NULL) 00381 { 00382 returnMsg->incRef(); 00383 ((IObjectIA *)msg.getContinuation())->sendMessage(returnMsg); 00384 } 00385 break; 00386 case IMessageBase::PAchieve: 00387 returnMsg = runAchieve(msg); 00388 if(msg.getContinuation() != NULL) 00389 { 00390 returnMsg->incRef(); 00391 ((IObjectIA *)msg.getContinuation())->sendMessage(returnMsg); 00392 } 00393 break; 00394 case IMessageBase::PAsk: 00395 returnMsg = runAsk(msg); 00396 returnMsg->setPerformatif(IMessageBase::PTell); 00397 returnMsg->incRef(); 00398 ((IObjectIA *)msg.getSender())->sendMessage(returnMsg); 00399 if(msg.getContinuation() != NULL) 00400 { 00401 returnMsg->incRef(); 00402 ((IObjectIA *)msg.getContinuation())->sendMessage(returnMsg); 00403 } 00404 break; 00405 case IMessageBase::PTell: 00406 returnMsg = runTell(msg); 00407 00408 break; 00409 case IMessageBase::PBreak: 00410 returnMsg = runBreak(msg); 00411 break; 00412 case IMessageBase::PKill: 00413 returnMsg = runKill(msg); 00414 break; 00415 case IMessageBase::PError: 00416 returnMsg = runError(msg); 00417 break; 00418 00419 case IMessageBase::PEven: 00420 returnMsg = runEven(msg); 00421 break; 00422 default: break; 00423 } 00424 00425 if(returnMsg) returnMsg->release(); 00426 return NULL; 00427 } |
|
The work of an agent. Typically agent process child message, process its message and run its activity. Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, and NLAIAGENT::COperatorScript. Definition at line 401 of file actor_script.cpp. References _OnActivateIndex, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::CAgentScript::getAgentManager(), processMessages(), r, NLAIAGENT::CAgentScript::run(), NLAIAGENT::CAgentScript::runMethodeMember(), and NLAISCRIPT::CCodeContext::Self.
00402 { 00403 if ( _IsActivated ) 00404 { 00405 if ( _OnActivateIndex != -1 ) 00406 { 00407 if ( getAgentManager() != NULL ) 00408 { 00409 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *) getAgentManager()->getAgentContext(); 00410 context->Self = this; 00411 CProcessResult r = runMethodeMember( _OnActivateIndex ,context); 00412 if ( r.Result != NULL ) 00413 r.Result->release(); 00414 _OnActivateIndex = -1; 00415 } 00416 } 00417 return CAgentScript::run(); 00418 } 00419 else 00420 { 00421 processMessages(); 00422 return IObjectIA::ProcessRun; 00423 } 00424 } |
|
runAchieve ist to processing reltative to PAchieve Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Definition at line 127 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType(). Referenced by NLAIAGENT::IBasicAgent::run().
00128 { 00129 std::string debugString; 00130 std::string text; 00131 getDebugString(debugString); 00132 text = "IMessageBase *runAchieve("; 00133 text += (const char *)m.getType(); 00134 text += " note implementaited for the '"; 00135 text += (const char *)getType(); 00136 text += "' interface for the instence '"; 00137 text += (const char *)getType(); 00138 text += "' '"; 00139 text += debugString; 00140 text += "'"; 00141 00142 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00143 return NULL; 00144 } |
|
Mailer do'nt have own activity.
Reimplemented from NLAIAGENT::IAgent. Reimplemented in NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentClockTimer, and NLAIAGENT::CAgentOperation. Definition at line 1607 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAIAGENT::CAgentScript::_AgentManager, NLAIAGENT::IAgentManager::getAgentContext(), NLAISCRIPT::CAgentClass::getRunMethod(), NLAIAGENT::CAgentScript::runMethodeMember(), and NLAISCRIPT::CCodeContext::Self. Referenced by NLAIAGENT::CMainAgentScript::run().
01608 { 01609 01610 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *)_AgentManager->getAgentContext(); 01611 context->Self = this; 01612 if(_AgentClass->getRunMethod() >= 0) runMethodeMember(_AgentClass->getRunMethod(), context); 01613 01614 return ProcessRun; 01615 } |
|
runAsk is to processing reltative to PAsk Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Definition at line 546 of file agents.cpp. References NLAIC::IBasicType::getDebugString(), NLAIAGENT::IConnectIA::getParent(), NLAIC::IBasicType::getType(), and NLAIC::stringGetBuild(). Referenced by NLAIAGENT::IBasicAgent::run().
00547 { 00548 if(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass == m.getType()) 00549 { 00550 if(getParent() != NULL) 00551 { 00552 CNotifyParentScript *msg = new CNotifyParentScript(); 00553 return msg; 00554 } 00555 else 00556 { 00557 CNotifyParentScript *msg = new CNotifyParentScript((IBasicAgent *)getParent()); 00558 return msg; 00559 } 00560 } 00561 else 00562 { 00563 std::string debugString; 00564 std::string text; 00565 getDebugString(debugString); 00566 text += NLAIC::stringGetBuild("runAsk(%s) note implementaited for the '%s' interface for the instence '%s'",(const char *)m.getType(),(const char *)getType(),debugString.c_str()); 00567 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00568 return NULL; 00569 } 00570 } |
|
This function process the message ask debug string for the runTell. Definition at line 923 of file agent_script.cpp. References NLAIC::CIdentType::allocClass(), NLAIAGENT::IBaseGroupType::get(), NLAIAGENT::CAgentScript::getDebugString(), NLAIAGENT::IConnectIA::getParent(), NLAIAGENT::IMessageBase::getSender(), NLAIC::IBasicType::getType(), NLAIAGENT::CAgentScript::getType(), NLAIAGENT::IListBasicManager::push(), r, NLAIAGENT::IMessageBase::setPerformatif(), and NLAIAGENT::IMessageBase::setSender(). Referenced by NLAIAGENT::CAgentScript::runMethodBase().
00924 { 00925 00926 #ifdef NL_DEBUG 00927 const char *text = (const char *)getType(); 00928 const char *textP = (const char *)getParent()->getType(); 00929 #endif 00930 static NLAIC::CIdentType idMsgDebugString ("MsgDebugString"); 00931 00932 NLAIAGENT::IMessageBase &mOriginal = (NLAIAGENT::IMessageBase &)*g->get(); 00933 00934 IMessageBase *m = (IMessageBase *)idMsgDebugString.allocClass(); 00935 m->setPerformatif(IMessageBase::PTell); 00936 m->setSender(this); 00937 00938 std::string str; 00939 getDebugString(str); 00940 00941 m->push(new CStringType(str)); 00942 00943 if(mOriginal.getSender() != NULL) 00944 ((IObjectIA *)mOriginal.getSender())->sendMessage((IObjectIA *)m); 00945 00946 IObjectIA::CProcessResult r; 00947 00948 //m->incRef(); 00949 r.Result = m; 00950 return r; 00951 } |
|
|
This function process the message CNotifyParentScript for the runAsk. Definition at line 912 of file agent_script.cpp. References NLAIAGENT::IConnectIA::getParent(), r, NLAIAGENT::IMessageBase::setPerformatif(), and NLAIAGENT::IMessageBase::setSender(). Referenced by NLAIAGENT::CAgentScript::runMethodBase().
|
|
runBreak is to processing reltative to PBreak Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Definition at line 159 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType(). Referenced by NLAIAGENT::IBasicAgent::run().
00160 { 00161 std::string debugString; 00162 std::string text; 00163 getDebugString(debugString); 00164 text = "IMessageBase *runBreak("; 00165 text += (const char *)m.getType(); 00166 text += " note implementaited for the '"; 00167 text += (const char *)getType(); 00168 text += "' interface for the instence '"; 00169 text += (const char *)getType(); 00170 text += "' '"; 00171 text += debugString; 00172 text += "'"; 00173 00174 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00175 return NULL; 00176 } |
|
Cancel a goal, it call by message manager when a cancel goal message is occure.
Definition at line 398 of file agent_script.h.
00399 {
00400 return IObjectIA::CProcessResult();
00401 }
|
|
Run all child. Reimplemented from NLAIAGENT::IAgent. Reimplemented in NLAIAGENT::CFsmScript, and NLAIAGENT::CSeqFsmScript. Definition at line 1377 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, NLAIAGENT::CAgentScript::getType(), NLAIAGENT::IObjectIA::run(), and NLAIAGENT::IAgent::runChildren(). Referenced by NLAIAGENT::CMainAgentScript::run().
01378 { 01379 #ifdef NL_DEBUG 01380 const char *classBase = (const char *)getType(); 01381 #endif 01382 // Activation des agents de la partie statique 01383 int i = _NbComponents; 01384 01385 IObjectIA **com = _Components; 01386 01387 while(i --) 01388 (*com ++)->run(); 01389 01390 // Activation des fils 01391 IAgent::runChildren(); 01392 } |
|
Activates the child agents.
Reimplemented from NLAIAGENT::IAgent. Definition at line 1394 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_iComponents, NLAIAGENT::CAgentScript::_NbComponents, NLAIAGENT::IObjectIA::run(), and NLAIAGENT::IAgent::runChildrenStepByStep().
01395 { 01396 if(_iComponents == _NbComponents) 01397 { 01398 if(IAgent::runChildrenStepByStep()) 01399 { 01400 _iComponents = 0; 01401 return true; 01402 } 01403 else return false; 01404 } 01405 01406 IObjectIA *o = _Components[_iComponents ++]; 01407 o->run(); 01408 01409 return false; 01410 } |
|
runError is to processing reltative to PError Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Definition at line 206 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType(). Referenced by NLAIAGENT::IBasicAgent::run().
00207 { 00208 std::string debugString; 00209 std::string text; 00210 getDebugString(debugString); 00211 text = "IMessageBase *runError("; 00212 text += (const char *)m.getType(); 00213 text += " note implementaited for the '"; 00214 text += (const char *)getType(); 00215 text += "' interface for the instence '"; 00216 text += (const char *)getType(); 00217 text += "' '"; 00218 text += debugString; 00219 text += "'"; 00220 00221 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00222 return NULL; 00223 } |
|
RunExec is to processing reltative to PExec Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Definition at line 105 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType(). Referenced by NLAIAGENT::IBasicAgent::run().
00106 { 00107 std::string debugString; 00108 std::string text; 00109 getDebugString(debugString); 00110 text = "IMessageBase *runEven("; 00111 text += (const char *)m.getType(); 00112 text += " note implementaited for the '"; 00113 text += (const char *)getType(); 00114 text += "' interface for the instence '"; 00115 text += (const char *)getType(); 00116 text += "' '"; 00117 text += debugString; 00118 text += "'"; 00119 00120 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00121 return NULL; 00122 } |
|
RunExec is to processing reltative to PExec Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Reimplemented in NLAIAGENT::CMainAgentScript. Definition at line 83 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType(). Referenced by NLAIAGENT::IBasicAgent::run().
00084 { 00085 std::string debugString; 00086 std::string text; 00087 getDebugString(debugString); 00088 text = "IMessageBase *runExec("; 00089 text += (const char *)m.getType(); 00090 text += " note implementaited for the '"; 00091 text += (const char *)getType(); 00092 text += "' interface for the instence '"; 00093 text += (const char *)getType(); 00094 text += "' '"; 00095 text += debugString; 00096 text += "'"; 00097 00098 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00099 return NULL; 00100 } |
|
Add a fact on the fact base, it occur when a fact message hapend.
Definition at line 404 of file agent_script.h.
00405 {
00406 return IObjectIA::CProcessResult();
00407 }
|
|
Run all goal message, it call by message manager when a goal message is occure.
Definition at line 392 of file agent_script.h.
00393 {
00394 return IObjectIA::CProcessResult();
00395 }
|
|
that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g); Definition at line 1103 of file agent_script.cpp. References NLAIAGENT::IBaseGroupType::get(), and r.
01104 { 01105 const char * class_name = ((NLAIAGENT::CStringVarName *)g->get())->getString(); 01106 NLAIC::CIdentType id_class( class_name ); 01107 01108 01109 01110 /* 01111 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get(); 01112 msg_result.incRef(); 01113 01114 01115 // Cleans previous components 01116 if ( _Components != NULL ) 01117 { 01118 for ( int i = 0; i < _NbComponents; i++ ) 01119 _Components[i]->release(); 01120 } 01121 01122 // Creates a new component array 01123 _NbComponents = (sint32) msg_result.size() / 3; 01124 _Components = new IObjectIA *[ _NbComponents ]; 01125 01126 int test = 0; 01127 01128 for ( int i = 0; i < msg_result.size() ; i += 3 ) 01129 { 01130 CStringType *comp_name = (CStringType *) msg_result[ (sint32) i ]; 01131 CStringType *comp_type = (CStringType *) msg_result[ (sint32) (i + 1) ]; 01132 IObjectIA *comp_val = (IObjectIA *) msg_result[ (sint32) (i + 2) ]; 01133 01134 sint32 index = getStaticMemberIndex( comp_name->getStr() ); //_AgentClass->getInheritedStaticMemberIndex( comp_name->getStr() ); 01135 if ( index != -1 ) 01136 { 01137 // Sets the component to the new value 01138 setStaticMember( index, comp_val ); 01139 } 01140 else 01141 { 01142 setStaticMember( (sint32) (i / 3) , comp_val ); 01143 } 01144 test++; 01145 } 01146 */ 01147 IObjectIA::CProcessResult r; 01148 r.Result = NULL; 01149 return r; 01150 } |
|
that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g); Definition at line 1060 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, NLAIAGENT::IBaseGroupType::get(), NLAIAGENT::CAgentScript::getStaticMemberIndex(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, r, NLAIC::IPointerGestion::release(), NLAIAGENT::CAgentScript::setStaticMember(), sint32, and NLAIAGENT::IListBasicManager::size(). Referenced by NLAIAGENT::CAgentScript::runMethodBase().
01061 { 01062 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get(); 01063 msg_result.incRef(); 01064 01065 01066 // Cleans previous components 01067 if ( _Components != NULL ) 01068 { 01069 for ( int i = 0; i < _NbComponents; i++ ) 01070 _Components[i]->release(); 01071 } 01072 01073 // Creates a new component array 01074 _NbComponents = (sint32) msg_result.size() / 3; 01075 _Components = new IObjectIA *[ _NbComponents ]; 01076 01077 int test = 0; 01078 01079 for ( int i = 0; i < msg_result.size() ; i += 3 ) 01080 { 01081 CStringType *comp_name = (CStringType *) msg_result[ (sint32) i ]; 01082 IObjectIA *comp_val = (IObjectIA *) msg_result[ (sint32) (i + 2) ]; 01083 01084 sint32 index = getStaticMemberIndex( comp_name->getStr() ); //_AgentClass->getInheritedStaticMemberIndex( comp_name->getStr() ); 01085 if ( index != -1 ) 01086 { 01087 // Sets the component to the new value 01088 setStaticMember( index, comp_val ); 01089 } 01090 else 01091 { 01092 setStaticMember( (sint32) (i / 3) , comp_val ); 01093 } 01094 test++; 01095 } 01096 01097 IObjectIA::CProcessResult r; 01098 msg_result.incRef(); 01099 r.Result = &msg_result; 01100 return r; 01101 } |
|
runKill is to processing reltative to PKill Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Reimplemented in NLAIAGENT::CAgentWatchTimer. Definition at line 184 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType(). Referenced by NLAIAGENT::IBasicAgent::run().
00185 { 00186 std::string debugString; 00187 std::string text; 00188 getDebugString(debugString); 00189 text = "IMessageBase *runKill("; 00190 text += (const char *)m.getType(); 00191 text += " note implementaited for the '"; 00192 text += (const char *)getType(); 00193 text += "' interface for the instence '"; 00194 text += (const char *)getType(); 00195 text += "' '"; 00196 text += debugString; 00197 text += "'"; 00198 00199 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00200 return NULL; 00201 } |
|
Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 630 of file actor_script.cpp. References _NbAnswers, activate(), fid_failure, fid_isactive, fid_launch, fid_msg_failure, fid_msg_success, fid_nb_answers, fid_onActivate, fid_onUnActivate, fid_owner, fid_pause, fid_restart, fid_success, fid_switch, fid_toplevel, NLAIAGENT::CAgentScript::getMethodIndexSize(), NLAIAGENT::IConnectIA::getParent(), getTopLevel(), NLAIC::IPointerGestion::incRef(), index, Launch(), onActivate(), onUnActivate(), params, pause(), processFailure(), processSuccess(), r, restart(), NLAIAGENT::CAgentScript::runMethodBase(), s, switchActor(), uint32, and unActivate().
00631 { 00632 int i = index - CAgentScript::getMethodIndexSize(); 00633 00634 00635 IObjectIA::CProcessResult r; 00636 std::vector<CStringType *> handles; 00637 00638 switch( i ) 00639 { 00640 00641 case fid_activate: 00642 activate(); 00643 r.ResultState = NLAIAGENT::processIdle; 00644 r.Result = NULL; 00645 break; 00646 00647 case fid_onActivate: 00648 onActivate(); 00649 r.ResultState = NLAIAGENT::processIdle; 00650 r.Result = NULL; 00651 break; 00652 00653 case fid_unActivate: 00654 unActivate(); 00655 r.ResultState = NLAIAGENT::processIdle; 00656 r.Result = NULL; 00657 break; 00658 00659 case fid_onUnActivate: 00660 onUnActivate(); 00661 r.ResultState = NLAIAGENT::processIdle; 00662 r.Result = NULL; 00663 return r; 00664 break; 00665 00666 case fid_switch: 00667 if ( ( (NLAIAGENT::IBaseGroupType *) params)->size() ) 00668 { 00669 const IObjectIA *fw = ( ((NLAIAGENT::IBaseGroupType *)params) )->get(); 00670 00671 //( ((NLAIAGENT::IBaseGroupType *)params))->popFront(); 00672 // while ( fw->size() ) 00673 // { 00674 handles.push_back( (CStringType *) fw); 00675 // fw->popFront(); 00676 // } 00677 00678 std::vector<CComponentHandle *> switched; 00679 int i; 00680 for ( i = 0; i < (int) handles.size(); i++) 00681 switched.push_back( new CComponentHandle( handles[ i ]->getStr(), (IAgent *) getParent() ) ); 00682 switchActor( switched, false ); 00683 for ( i = 0; i < (int) switched.size(); i++) 00684 delete switched[i]; 00685 } 00686 r.ResultState = NLAIAGENT::processIdle; 00687 r.Result = NULL; 00688 break; 00689 00690 case fid_launch: 00691 if ( ( (NLAIAGENT::IBaseGroupType *) params)->size() ) 00692 { 00693 /*IObjectIA *child = (IObjectIA *)((NLAIAGENT::IBaseGroupType *)params)->get(); 00694 addDynamicAgent( (NLAIAGENT::IBaseGroupType *) params); 00695 _NbAnswers++; 00696 if ( child->isClassInheritedFrom( CStringVarName("Actor") ) != -1 ) 00697 { 00698 if ( _TopLevel ) 00699 ((CActorScript *)child)->setTopLevel( _TopLevel ); 00700 else 00701 ((CActorScript *)child)->setTopLevel( this ); 00702 00703 ((CActorScript *)child)->activate(); 00704 } 00705 _Launched.push_back( (NLAIAGENT::IAgent *) child ); 00706 child->incRef();*/ 00707 00708 CIteratorContener i = ((NLAIAGENT::IBaseGroupType *) params)->getIterator(); 00709 CStringType &s = (CStringType &)*i++; 00710 IBasicAgent *a = (IBasicAgent *)i++; 00711 Launch(s.getStr().getString(), a); 00712 a->incRef(); 00713 00714 } 00715 r.ResultState = NLAIAGENT::processIdle; 00716 r.Result = NULL; 00717 return r; 00718 00719 case fid_pause: 00720 pause(); 00721 r.ResultState = NLAIAGENT::processIdle; 00722 r.Result = NULL; 00723 return r; 00724 break; 00725 00726 case fid_restart: 00727 restart(); 00728 r.ResultState = NLAIAGENT::processIdle; 00729 r.Result = NULL; 00730 return r; 00731 break; 00732 00733 case fid_success: 00734 case fid_msg_success: 00735 processSuccess(params); 00736 r.Result = new NLAIAGENT::CSuccessMsg(); 00737 return r; 00738 break; 00739 00740 case fid_failure: 00741 case fid_msg_failure: 00742 processFailure(params); 00743 r.Result = new NLAIAGENT::CFailureMsg(); 00744 return r; 00745 break; 00746 00747 case fid_nb_answers: 00748 _NbAnswers = (uint32) ( (NLAIAGENT::DigitalType *) ( (NLAIAGENT::IBaseGroupType *) params )->get() )->getNumber(); 00749 return r; 00750 00751 case fid_toplevel: 00752 r.Result = new CLocalAgentMail( (IBasicAgent *) getTopLevel() ); 00753 return r; 00754 break; 00755 00756 case fid_owner: 00757 r.Result = new CLocalAgentMail( (IBasicAgent *) getTopLevel()->getParent() ); 00758 return r; 00759 break; 00760 00761 case fid_isactive: 00762 r.Result = new NLAILOGIC::CBoolType( _IsActivated ); 00763 return r; 00764 break; 00765 } 00766 return CAgentScript::runMethodBase(index, params); 00767 } |
|
Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript. Definition at line 454 of file actor_script.cpp. References _Launched, _NbAnswers, activate(), NLAILOGIC::CGoalPath::addGoal(), NLAIC::IBasicType::clone(), fid_failure, fid_isactive, fid_launch, fid_launch_goal, fid_launched, fid_msg_failure, fid_msg_success, fid_nb_answers, fid_onActivate, fid_onUnActivate, fid_owner, fid_pause, fid_restart, fid_success, fid_switch, fid_toplevel, NLAIAGENT::IBaseGroupType::getFront(), NLAIAGENT::IConnectIA::getParent(), getTopLevel(), NLAIC::IPointerGestion::incRef(), index, Launch(), onActivate(), onFailure(), onSuccess(), onUnActivate(), params, pause(), NLAIAGENT::IBaseGroupType::popFront(), NLAIAGENT::CVectorGroupType::push(), r, restart(), s, NLAILOGIC::CGoalPath::setFather(), NLAIAGENT::IBaseGroupType::size(), switchActor(), uint32, and unActivate().
00455 { 00456 IObjectIA::CProcessResult r; 00457 00458 switch ( index ) 00459 { 00460 case fid_activate: 00461 activate(); 00462 r.ResultState = NLAIAGENT::processIdle; 00463 r.Result = NULL; 00464 break; 00465 00466 case fid_onActivate: 00467 onActivate(); 00468 r.ResultState = NLAIAGENT::processIdle; 00469 r.Result = NULL; 00470 break; 00471 00472 case fid_unActivate: 00473 unActivate(); 00474 r.ResultState = NLAIAGENT::processIdle; 00475 r.Result = NULL; 00476 break; 00477 00478 case fid_onUnActivate: 00479 onUnActivate(); 00480 r.ResultState = NLAIAGENT::processIdle; 00481 r.Result = NULL; 00482 break; 00483 00484 case fid_switch: 00485 { 00486 std::vector<CStringType *> handles; 00487 if ( ( (NLAIAGENT::IBaseGroupType *) params)->size() ) 00488 { 00489 IBaseGroupType *fw = (IBaseGroupType *) ( ((NLAIAGENT::IBaseGroupType *)params) )->getFront(); 00490 //( ((NLAIAGENT::IBaseGroupType *)params))->popFront(); 00491 while ( fw->size() ) 00492 { 00493 handles.push_back( (CStringType *) fw->getFront() ); 00494 fw->popFront(); 00495 } 00496 std::vector<CComponentHandle *> switched; 00497 for ( int i = 0; i < (int) handles.size(); i++) 00498 switched.push_back( new CComponentHandle( handles[ i ]->getStr() , (IAgent *) getParent() ) ); 00499 00500 switchActor( switched, false ); 00501 } 00502 r.ResultState = NLAIAGENT::processIdle; 00503 r.Result = NULL; 00504 } 00505 break; 00506 00507 case fid_launch: 00508 00509 if ( ( (NLAIAGENT::IBaseGroupType *) params)->size() ) 00510 { 00511 /*IObjectIA *child = (IObjectIA *)((NLAIAGENT::IBaseGroupType *)params)->get(); 00512 addDynamicAgent( (NLAIAGENT::IBaseGroupType *) params); 00513 if ( child->isClassInheritedFrom( CStringVarName("Actor") ) != -1 ) 00514 { 00515 if ( _TopLevel ) 00516 ((CActorScript *)child)->setTopLevel( _TopLevel ); 00517 else 00518 ((CActorScript *)child)->setTopLevel( this ); 00519 00520 ((CActorScript *)child)->activate(); 00521 } 00522 00523 _Launched.push_back( (NLAIAGENT::IAgent *) child ); 00524 child->incRef();*/ 00525 CIteratorContener i = ((NLAIAGENT::IBaseGroupType *) params)->getIterator(); 00526 CStringType &s = (CStringType &)*i++; 00527 IBasicAgent *a = (IBasicAgent *)i++; 00528 Launch(s.getStr().getString(), a); 00529 a->incRef(); 00530 } 00531 r.ResultState = NLAIAGENT::processIdle; 00532 r.Result = NULL; 00533 return r; 00534 00535 case fid_launch_goal: 00536 { 00537 NLAILOGIC::CGoalPath *goal_path = new NLAILOGIC::CGoalPath( this ); 00538 goal_path->setFather( (CProxyAgentMail *) new CLocalAgentMail( this ) ); 00539 // If the constructor() function is explicitely called and the object has already been initialised 00540 NLAIAGENT::IBaseGroupType *p = (NLAIAGENT::IBaseGroupType *) params; 00541 while ( p->size() ) 00542 { 00543 goal_path->addGoal( (NLAILOGIC::CGoal *) p->getFront()->clone() ); 00544 p->popFront(); 00545 } 00546 Launch( "goal_path", goal_path ); 00547 goal_path->incRef(); 00548 return IObjectIA::CProcessResult(); 00549 } 00550 00551 case fid_launched: 00552 { 00553 CVectorGroupType *result = new CVectorGroupType(); 00554 std::list<IBasicAgent *>::iterator it_l = _Launched.begin(); 00555 00556 while ( it_l != _Launched.end() ) 00557 { 00558 result->push( new CLocalMailBox( (const NLAIAGENT::IWordNumRef *) **it_l ) ); 00559 it_l++; 00560 } 00561 r.ResultState = NLAIAGENT::processIdle; 00562 r.Result = result; 00563 return r; 00564 } 00565 00566 case fid_pause: 00567 pause(); 00568 r.ResultState = NLAIAGENT::processIdle; 00569 r.Result = NULL; 00570 return r; 00571 00572 case fid_restart: 00573 restart(); 00574 r.ResultState = NLAIAGENT::processIdle; 00575 r.Result = NULL; 00576 return r; 00577 00578 case fid_success: 00579 case fid_msg_success: 00580 onSuccess(params); 00581 r.Result = new NLAIAGENT::CSuccessMsg(); 00582 return r; 00583 00584 case fid_failure: 00585 case fid_msg_failure: 00586 onFailure(params); 00587 r.Result = new NLAIAGENT::CFailureMsg(); 00588 return r; 00589 00590 case fid_nb_answers: 00591 _NbAnswers = (uint32) ( (NLAIAGENT::DigitalType *) ( (NLAIAGENT::IBaseGroupType *) params )->get() )->getNumber(); 00592 return r; 00593 00594 case fid_toplevel: 00595 r.Result = new CLocalAgentMail( (IBasicAgent *) getTopLevel() ); 00596 return r; 00597 00598 case fid_owner: 00599 r.Result = new CLocalAgentMail( (IBasicAgent *) getTopLevel()->getParent() ); 00600 return r; 00601 00602 case fid_isactive: 00603 r.Result = new NLAILOGIC::CBoolType( _IsActivated ); 00604 return r; 00605 } 00606 return r; 00607 } |
|
The methode runMethodeMember(sint32 index,IObjectIA *param) allow us to run a own member method. index: is the method id return by the isMember(const IVarName *,const IVarName *,const IObjectIA &) const method. param: is the parametre for the method. Reimplemented from NLAIAGENT::IBasicAgent. Reimplemented in NLAIAGENT::CAgentWatchTimer. Definition at line 2172 of file agent_script.cpp. References NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CCodeContext::ContextDebug, NLAIAGENT::CAgentScript::getBaseMethodCount(), NLAIAGENT::CAgentScript::getMethode(), NLAIC::IBasicType::getType(), index, NLAISCRIPT::CCodeContext::Param, r, NLAIAGENT::CAgentScript::runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), sint32, NLAISCRIPT::CCodeContext::Stack, and uint32.
02173 { 02174 if(c->getType() != NLAISCRIPT::CCodeContext::IdCodeContext) 02175 { 02176 return IAgent::runMethodeMember(index, c); 02177 } 02178 02179 NLAISCRIPT::IOpCode *opPtr = NULL; 02180 NLAISCRIPT::CCodeContext &context = (NLAISCRIPT::CCodeContext &)*c; 02181 02182 int i = index - getBaseMethodCount(); 02183 if(i < 0) 02184 { 02185 /*if (context.ContextDebug.Active) 02186 { 02187 context.ContextDebug.Param.push_back(&listBidon); 02188 listBidon.incRef(); 02189 }*/ 02190 02191 IObjectIA::CProcessResult r = runMethodBase(index,(IObjectIA *)context.Param.back()); 02192 if(r.Result != NULL) 02193 { 02194 context.Stack++; 02195 context.Stack[(int)context.Stack] = r.Result; 02196 } 02197 r.Result = NULL; 02198 return r; 02199 } 02200 else 02201 { 02202 opPtr = getMethode(i); 02203 } 02204 IObjectIA::CProcessResult r; 02205 if(opPtr != NULL) 02206 { 02207 NLAISCRIPT::CCodeBrancheRun *opTmp = context.Code; 02208 int ip; 02209 if(context.Code != NULL) ip = (uint32)*context.Code; 02210 else ip =0; 02211 context.Code = (NLAISCRIPT::CCodeBrancheRun *)opPtr; 02212 *context.Code = 0; 02213 02214 r = ((NLAISCRIPT::ICodeBranche *)opPtr)->run(context); 02215 02216 // If we are in Debug Mode 02217 if (context.ContextDebug.Active) 02218 { 02219 context.ContextDebug.callStackPop(); 02220 } 02221 02222 *context.Code = ip; 02223 context.Code = opTmp; 02224 } 02225 return r; 02226 } |
|
The methode runMethodeMember(sint32 heritance, sint32 index, IObjectIA *param) allow us to run a member method. heritance: is the id returned by the methodisClassInheritedFrom(const IVarName &). index: is the method id return by the isMember(const IVarName *,const IVarName *,const IObjectIA &) const method. param: is the parametre for the method. Reimplemented from NLAIAGENT::IBasicAgent. Definition at line 2112 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CCodeContext::ContextDebug, NLAIAGENT::CAgentScript::getBaseMethodCount(), NLAISCRIPT::CAgentClass::getBrancheCode(), NLAIAGENT::CAgentScript::getMethode(), NLAIC::IBasicType::getType(), index, NLAISCRIPT::CCodeContext::Param, r, NLAIAGENT::CAgentScript::runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), sint32, NLAISCRIPT::CCodeContext::Stack, and uint32. Referenced by NLAIAGENT::COperatorScript::execOnActivate(), failure(), pause(), restart(), NLAIAGENT::CMainAgentScript::run(), run(), NLAIAGENT::CAgentScript::runActivity(), success(), and unActivate().
02113 { 02114 02115 if(c->getType() != NLAISCRIPT::CCodeContext::IdCodeContext) 02116 { 02117 return IAgent::runMethodeMember(inheritance,index, c); 02118 } 02119 02120 NLAISCRIPT::IOpCode *opPtr = NULL; 02121 NLAISCRIPT::CCodeContext &context = (NLAISCRIPT::CCodeContext &)*c; 02122 02123 int i = index - getBaseMethodCount(); 02124 if(i < 0) 02125 { 02126 /*if (context.ContextDebug.Active) 02127 { 02128 context.ContextDebug.Param.push_back(&listBidon); 02129 listBidon.incRef(); 02130 }*/ 02131 02132 IObjectIA::CProcessResult r = runMethodBase(index,(IObjectIA *)context.Param.back()); 02133 if(r.Result != NULL) 02134 { 02135 context.Stack++; 02136 context.Stack[(int)context.Stack] = r.Result; 02137 } 02138 r.Result = NULL; 02139 return r; 02140 } 02141 else 02142 { 02143 opPtr = getMethode(inheritance,i); 02144 } 02145 02146 IObjectIA::CProcessResult r; 02147 if(opPtr != NULL) 02148 { 02149 #ifdef NL_DEBUG 02150 std::string nameDbg; 02151 _AgentClass->getBrancheCode(inheritance,i).getName().getDebugString(nameDbg); 02152 _AgentClass->getBrancheCode(inheritance,i).getParam().getDebugString(nameDbg); 02153 #endif 02154 NLAISCRIPT::IOpCode &op = *opPtr; 02155 NLAISCRIPT::CCodeBrancheRun *opTmp = context.Code; 02156 int ip = (uint32)*context.Code; 02157 context.Code = (NLAISCRIPT::CCodeBrancheRun *)&op; 02158 *context.Code = 0; 02159 02160 r = ((NLAISCRIPT::ICodeBranche *)opPtr)->run(context); 02161 // If we are in Debug Mode 02162 if (context.ContextDebug.Active) 02163 { 02164 context.ContextDebug.callStackPop(); 02165 } 02166 *context.Code = ip; 02167 context.Code = opTmp; 02168 } 02169 return r; 02170 } |
|
runService is to processing reltative to PService Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Definition at line 228 of file agent.h. References NLAIC::IBasicType::getDebugString(), and NLAIC::IBasicType::getType().
00229 { 00230 std::string debugString; 00231 std::string text; 00232 getDebugString(debugString); 00233 text = "IMessageBase *runService("; 00234 text += (const char *)m.getType(); 00235 text += " note implementaited for the '"; 00236 text += (const char *)getType(); 00237 text += "' interface for the instence '"; 00238 text += (const char *)getType(); 00239 text += "' '"; 00240 text += debugString; 00241 text += "'"; 00242 00243 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00244 return NULL; 00245 } |
|
Some where Run method define the process of the agen. Reimplemented from NLAIAGENT::IAgent. Definition at line 1655 of file agent_script.cpp. References NLAIAGENT::CAgentScript::getType().
01656 { 01657 01658 #ifdef NL_DEBUG 01659 const char *dbg_class_name = (const char *) getType(); 01660 //const NLAIAGENT::IRefrence *dbg_mail_parent = _ScriptMail->getParent(); 01661 #endif 01662 01663 return IAgentManager::runStep(); 01664 01665 } |
|
runTell is to processing reltative to PTell Performatif. its call from the IObjectIA *run(const IMessageBase &m) method. Reimplemented from NLAIAGENT::IBasicAgent. Definition at line 1020 of file actor_script.cpp. References NLAIAGENT::IMessageBase::getMessageGroup(), and processSuccess().
01021 { 01022 processSuccess( (NLAIAGENT::IObjectIA *) m.getMessageGroup() ); 01023 return new NLAIAGENT::CSuccessMsg(); 01024 } |
|
|
This function process the message CNotifyParentScript for the runTell. Definition at line 953 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, NLAIAGENT::CNotifyParentScript::clone(), NLAIAGENT::IConnectIA::getParent(), NLAIC::IBasicType::getType(), NLAIAGENT::CAgentScript::getType(), r, NLAIC::IPointerGestion::release(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), sint, t, and uint. Referenced by NLAIAGENT::CAgentScript::runMethodBase().
00954 { 00955 sint i; 00956 00957 #ifdef NL_DEBUG 00958 const char *text = (const char *)getType(); 00959 const char *textP = (const char *)getParent()->getType(); 00960 #endif 00961 CNotifyParentScript *m = new CNotifyParentScript(this); 00962 m->setPerformatif(IMessageBase::PTell); 00963 m->setSender(this); 00964 00965 for(i = 0; i < _NbComponents; i++) 00966 { 00967 if(_Components[i] != NULL) 00968 { 00969 CNotifyParentScript *msg = (CNotifyParentScript *)m->clone(); 00970 try 00971 { 00972 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent; 00973 const NLAIC::CTypeOfObject &t = _Components[i]->getType(); 00974 00975 if((t.getValue() & b) == b) 00976 _Components[i]->sendMessage(msg); 00977 } 00978 catch(NLAIE::IException &) 00979 { 00980 msg->release(); 00981 } 00982 } 00983 } 00984 IObjectIA::CProcessResult r; 00985 r.Result = m; 00986 return r; 00987 } |
|
that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g); Definition at line 1032 of file agent_script.cpp. References NLAIAGENT::IBaseGroupType::get(), NLAIAGENT::CAgentScript::getStaticMemberIndex(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, r, NLAIAGENT::CAgentScript::setStaticMember(), sint32, and NLAIAGENT::IListBasicManager::size(). Referenced by NLAIAGENT::CAgentScript::runMethodBase().
01033 { 01034 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get(); 01035 msg_result.incRef(); 01036 01037 while ( msg_result.size() ) 01038 { 01039 CStringType *comp_name = (CStringType *) msg_result[ (sint32) 0 ]; 01040 IObjectIA *comp_val = (IObjectIA *) msg_result[ (sint32) 1 ]; 01041 01042 sint32 index = getStaticMemberIndex( comp_name->getStr() ); 01043 if ( index != -1 ) 01044 { 01045 // Sets the component to the new value 01046 setStaticMember( index, comp_val ); 01047 } 01048 else 01049 { 01050 // Component not found: creates it 01051 01052 } 01053 } 01054 IObjectIA::CProcessResult r; 01055 msg_result.incRef(); 01056 r.Result = &msg_result; 01057 return r; 01058 } |
|
programmer have to call this method to load or save internal attribut. Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript. Definition at line 431 of file actor_script.cpp. References NLAIAGENT::CAgentScript::save(), NLMISC::IStream::serial(), and sint32.
00432 { 00433 CAgentScript::save(os); 00434 sint32 b = (_IsActivated == false); 00435 os.serial( b ); 00436 } |
|
Definition at line 1197 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIC::IPointerGestion::incRef(), and NLAIAGENT::IObjectIA::sendMessage().
01198 { 01199 TSetDefNameAgent::iterator i = _DynamicAgentName.begin(); 01200 01201 if(i != _DynamicAgentName.end()) 01202 { 01203 ((IObjectIA *)(*(*(i)).Itr))->sendMessage(m); 01204 i ++; 01205 01206 while(i != _DynamicAgentName.end()) 01207 { 01208 m->incRef(); 01209 IObjectIA *o = ((IObjectIA *)(*(*(i)).Itr)); 01210 o->sendMessage(m); 01211 i++; 01212 } 01213 } 01214 01215 return IObjectIA::CProcessResult(); 01216 } |
|
Send message to an receiver agent.
Definition at line 326 of file agents.cpp. References NLAIAGENT::IMailBox::addMessage(), and NLAIAGENT::IBasicAgent::getMail().
00327 {
00328 receiver.getMail()->addMessage( msg );
00329 return IObjectIA::ProcessRun;
00330 }
|
|
Send a message to the agent.
Implements NLAIAGENT::IConnectIA. Definition at line 320 of file agents.cpp. References NLAIAGENT::IBasicAgent::_Mail, and NLAIAGENT::IMailBox::addMessage(). Referenced by NLAILOGIC::IGoal::failure(), NLAIAGENT::CAgentScript::sendMessage(), and NLAILOGIC::IGoal::success().
00321 { 00322 _Mail->addMessage(msg); 00323 return IObjectIA::ProcessRun; 00324 } |
|
This method allow to send a message to an compoment given by an string IVarName. Reimplemented from NLAIAGENT::IObjectIA. Definition at line 1250 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentClass, NLAIAGENT::CAgentScript::getStaticMember(), NLAIAGENT::CAgentScript::getStaticMemberIndex(), NLAIAGENT::IVarName::getString(), NLAIC::IBasicType::getType(), NLAIAGENT::processError, NLAIC::IPointerGestion::release(), NLAIAGENT::IObjectIA::sendMessage(), and NLAIAGENT::CAgentScript::sendMessageToDynmaicChild().
01251 { 01252 #ifdef NL_DEBUG 01253 const char *txt = (const char *)msg->getType(); 01254 const char *compNameDb = (const char *)compName.getString(); 01255 //nlinfo("MSG %s %4x", txt, this); 01256 #endif 01257 if(_AgentClass != NULL) 01258 { 01259 int i = getStaticMemberIndex(compName); 01260 if(i >= 0) 01261 { 01262 IObjectIA *comp = (IObjectIA *)getStaticMember(i); 01263 if(comp != NULL) 01264 { 01265 comp->sendMessage(msg); 01266 } 01267 else 01268 { 01269 if(sendMessageToDynmaicChild(compName,msg).ResultState == processError) msg->release(); 01270 } 01271 } 01272 else 01273 { 01274 if(sendMessageToDynmaicChild(compName,msg).ResultState == processError) msg->release(); 01275 } 01276 } 01277 else 01278 { 01279 if(sendMessageToDynmaicChild(compName,msg).ResultState == processError) msg->release(); 01280 } 01281 return IObjectIA::CProcessResult(); 01282 } |
|
sendMessage allow agent to send a message to an ather agent. The message is a IMessageBase. Reimplemented from NLAIAGENT::CAgentScript. Definition at line 390 of file actor_script.cpp. References NLAIAGENT::CAgentScript::sendMessage().
00391 {
00392 return CAgentScript::sendMessage(m);
00393 }
|
|
Definition at line 1218 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_DynamicAgentName, NLAIC::IBasicType::clone(), NLAIC::IBasicType::getDebugString(), NLAIC::IBasicType::getType(), NLAIAGENT::processError, r, and NLAIAGENT::CAgentScript::sendMessage(). Referenced by NLAIAGENT::CAgentScript::sendMessage().
01219 { 01220 //TSetDefNameAgent::iterator p = _DynamicAgentName.find(CKeyAgent(CStringType(compName))); 01221 std::pair<TSetDefNameAgent::iterator,TSetDefNameAgent::iterator> p = _DynamicAgentName.equal_range(CKeyAgent(CStringType(compName))); 01222 01223 #ifdef NL_DEBUG 01224 const char *txt = (const char *)msg->getType(); 01225 std::string txtName; 01226 compName.getDebugString(txtName); 01227 #endif 01228 01229 IObjectIA::CProcessResult r; 01230 01231 if(p.first != p.second) 01232 { 01233 while(p.first != p.second) 01234 { 01235 CAgentScript *o = (CAgentScript *)*((*(p.first)).Itr); 01236 o->sendMessage(msg); 01237 p.first ++; 01238 if(p.first != p.second) msg = (IObjectIA *)msg->clone(); 01239 } 01240 } 01241 else 01242 { 01243 r.ResultState = processError; 01244 r.Result = NULL; 01245 } 01246 01247 return r; 01248 } |
|
Definition at line 1177 of file agent_script.cpp. References NLAIAGENT::INombreDefine::getNumber(), param, NLAIC::IPointerGestion::release(), NLAIAGENT::CAgentScript::sendMessage(), NLAIAGENT::IMessageBase::setPerformatif(), and sint. Referenced by NLAIAGENT::CAgentScript::runMethodBase().
01178 { 01179 INombreDefine *p = (INombreDefine *)((IBaseGroupType *)param)->popFront(); 01180 IMessageBase *msg = (IMessageBase *)((IBaseGroupType *)param)->popFront(); 01181 msg->setPerformatif((IMessageBase::TPerformatif)(sint)p->getNumber()); 01182 p->release(); 01183 return sendMessage(msg); 01184 } |
|
Definition at line 1186 of file agent_script.cpp. References NLAIAGENT::INombreDefine::getNumber(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), param, NLAIAGENT::CAgentScript::sendMessage(), NLAIAGENT::IMessageBase::setPerformatif(), and sint. Referenced by NLAIAGENT::CAgentScript::runMethodBase().
01187 { 01188 NLAIAGENT::CIteratorContener It = ((IBaseGroupType *)param)->getIterator(); 01189 const CStringType *n = (const CStringType *)It++; 01190 INombreDefine *p = (INombreDefine *)((IBaseGroupType *)It++); 01191 IMessageBase *msg = (IMessageBase *)((IBaseGroupType *)It++); 01192 msg->setPerformatif((IMessageBase::TPerformatif)(sint)p->getNumber()); 01193 msg->incRef(); 01194 return sendMessage(n->getStr(),msg); 01195 } |
|
Reimplemented from NLAIC::IPointerGestion. Definition at line 328 of file abstract_interface.h. References NLAIC::IBasicInterface::load(), and NLAIC::IBasicInterface::save().
|
|
Set the manager for this instance.
Definition at line 496 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_AgentManager, NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, NLAIC::IBasicType::getType(), t, and uint.
00497 { 00498 //if(_AgentManager != NULL) _AgentManager->release(); 00499 _AgentManager = manager; 00500 for ( int i = 0; i < _NbComponents; i++ ) 00501 { 00502 00503 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent; 00504 const NLAIC::CTypeOfObject &t = (const NLAIC::CTypeOfObject &)_Components[i]->getType(); 00505 if( (t.getValue() & b ) == b) 00506 { 00507 ((CAgentScript *)_Components[i])->setAgentManager(_AgentManager); 00508 } 00509 } 00510 } |
|
Definition at line 461 of file baseai.cpp. References NLAIAGENT::IRefrence::_NumRef, NLAIAGENT::IWordNumRef::getNumIdent(), and NLAIC::IPointerGestion::release().
00462 { 00463 if(_NumRef != NULL) _NumRef->release(); 00464 _NumRef = new CLocWordNumRef(ref.getNumIdent(),this); 00465 } |
|
to set the parent of the agents.
Reimplemented from NLAIAGENT::IRefrence. Definition at line 661 of file baseai.cpp. References NLAIAGENT::IConnectIA::connect(), and NLAIAGENT::IConnectIA::getParent(). Referenced by NLAIAGENT::CAgentScript::addDynamicAgent(), NLAIAGENT::IAgentComposite::deleteListe(), NLAIAGENT::IBasicAgent::IBasicAgent(), NLAIAGENT::IConnectIA::onKill(), NLAIAGENT::CProxyAgentMail::sendMessage(), NLAIAGENT::CLocalAgentMail::sendMessage(), and NLAIAGENT::IBasicAgent::~IBasicAgent().
00662 { 00663 IRefrence::setParent(parent); 00664 IConnectIA *p = (IConnectIA *)getParent(); 00665 00666 if(p != NULL) connect(p); 00667 } |
|
Set the state of an agent.
Implements NLAIAGENT::IConnectIA. Definition at line 314 of file agents.cpp. References NLAIAGENT::IBasicAgent::_RunState. Referenced by NLAIAGENT::CAgentWatchTimer::runActivity(), NLAIAGENT::CAgentWatchTimer::runKill(), and NLAIAGENT::CAgentWatchTimer::runTell().
|
|
to cahnge a given components given by an index. Definition at line 268 of file baseai.h. References NLAIAGENT::IObjectIA::getStaticMemberIndex(). Referenced by NLAISCRIPT::CAffHeapMemberiOpCode::runOpCode(), NLAISCRIPT::CAffMemberiOpCode::runOpCode(), and NLAIAGENT::CLocalAgentMail::setStaticMember().
00269 { 00270 return setStaticMember(getStaticMemberIndex(compName),change); 00271 } |
|
to cahnge a given components given by a string. Reimplemented from NLAIAGENT::IObjectIA. Definition at line 517 of file agent_script.cpp. References NLAIAGENT::CAgentScript::_Components, NLAIAGENT::CAgentScript::_NbComponents, index, NLAIC::IPointerGestion::release(), sint32, t, and uint. Referenced by NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIAGENT::COperatorScript::linkGoalArgs(), NLAIAGENT::CAgentScript::runInitComponent(), and NLAIAGENT::CAgentScript::runTellSetValue().
00518 { 00519 #ifdef NL_DEBUG 00520 if ( index >= _NbComponents ) 00521 { 00522 throw NLAIE::CExceptionIndexError(); 00523 } 00524 #endif 00525 IObjectIA *old_comp = _Components[ index ]; 00526 _Components[ index ] = op; 00527 00528 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent; 00529 const NLAIC::CTypeOfObject &t = op->getType(); 00530 if((t.getValue() & b) == b) 00531 { 00532 ((CAgentScript *)op)->setParent( (const IWordNumRef *) *this); 00533 } 00534 if(op != old_comp) 00535 { 00536 old_comp->release(); 00537 return false; 00538 } 00539 return true; 00540 } |
|
Set the top level agent of this one.
Reimplemented from NLAIAGENT::CAgentScript. Reimplemented in NLAIAGENT::CFsmScript. Definition at line 932 of file actor_script.cpp. References _TopLevel, NLAIAGENT::IObjectIA::isClassInheritedFrom(), and NLAIAGENT::CAgentScript::setTopLevel().
00933 { 00934 _TopLevel = tl; 00935 00936 for (int i = 0; i < _NbComponents; i++ ) 00937 { 00938 if ( _Components[i]->isClassInheritedFrom( NLAIAGENT::CStringVarName("Actor") ) != -1 ) 00939 { 00940 if ( _TopLevel ) 00941 ( (CActorScript *)_Components[i] )->setTopLevel( _TopLevel ); 00942 else 00943 ( (CActorScript *)_Components[i] )->setTopLevel( this ); 00944 } 00945 } 00946 } |
|
That function allow user to change the 7 bit of the type field in the sid agent number;.
Definition at line 485 of file baseai.cpp. References NLAIAGENT::IRefrence::_NumRef, NLAIAGENT::CNumericIndex::getId(), NLAIAGENT::IWordNumRef::getNumIdent(), t, and uint64. Referenced by NLAIAGENT::IRefrence::IRefrence().
00486 { 00487 ((CAgentNumber &)(_NumRef->getNumIdent().getId())).setTypeAt(t); 00488 } |
|
Reimplemented in NLAILOGIC::CGoalPath. Definition at line 966 of file actor_script.cpp. References _OnSuccessIndex, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::CAgentScript::getAgentManager(), NLAISCRIPT::CAgentClass::isMember(), onSuccess(), r, NLAIAGENT::CAgentScript::runMethodeMember(), NLAISCRIPT::CCodeContext::Self, and NLAIAGENT::TQueue. Referenced by processSuccess().
00967 { 00968 static CStringVarName onsuccess_func_name("OnSuccess"); 00969 TQueue r = _AgentClass->isMember( NULL, &onsuccess_func_name, NLAISCRIPT::CParam() ); 00970 if ( !r.empty() ) 00971 { 00972 _OnSuccessIndex = r.top().Index; 00973 const NLAIAGENT::IAgentManager *manager = getAgentManager(); 00974 if ( manager != NULL ) 00975 { 00976 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *) manager->getAgentContext(); 00977 context->Self = this; 00978 runMethodeMember( _OnSuccessIndex ,context); 00979 _OnSuccessIndex = -1; 00980 } 00981 } 00982 onSuccess( NULL ); 00983 } |
|
Transfers activity to another actor. The second arg bool must be set to true for this agent to stay active, false otherwise. Definition at line 323 of file actor_script.cpp. References activate(), nlwarning, and unActivate().
00324 { 00325 std::vector<CComponentHandle *>::iterator it_handle = handles.begin(); 00326 while ( it_handle != handles.end() ) 00327 { 00328 CActorScript *actor = (CActorScript *)( *it_handle )->getValue(); 00329 if ( actor != NULL ) 00330 actor->activate(); 00331 else 00332 { 00333 const char *sw_name = (*it_handle)->getCompName()->getString(); 00334 nlwarning("SWITCH: component %s not found.", sw_name); 00335 } 00336 it_handle++; 00337 } 00338 // TODO: Envoi de message "activate" 00339 if ( !stay_active ) 00340 unActivate(); 00341 } |
|
Transfers activity to another actor. The second arg bool must be set to true for this agent to stay active, false otherwise. Definition at line 306 of file actor_script.cpp. References unActivate().
00307 { 00308 std::vector<CActorScript *>::iterator it_act = actors.begin(); 00309 while ( it_act != actors.end() ) 00310 { 00311 ( *it_act )->activate(); 00312 it_act++; 00313 } 00314 00315 // TODO: Envoi de message "activate" 00316 if ( !stay_active ) 00317 unActivate(); 00318 } |
|
Transfers activity to another actor. The second arg bool must be set to true for this agent to stay active, false otherwise. Definition at line 295 of file actor_script.cpp. References activate(), and unActivate(). Referenced by runMethodBase().
00296 { 00297 receiver->activate(); 00298 00299 if ( !stay_active && ( receiver != this ) ) 00300 unActivate(); 00301 } |
|
Unactivates the actor.
Definition at line 149 of file actor_script.cpp. References _IsPaused, _Launched, _OnActivateIndex, _OnUnActivateIndex, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::CAgentScript::getAgentManager(), NLAIAGENT::CAgentScript::getClass(), NLAIAGENT::IConnectIA::getParent(), NLAISCRIPT::CAgentClass::isClassInheritedFrom(), NLAISCRIPT::CAgentClass::isMember(), onUnActivate(), r, NLAIAGENT::CAgentScript::removeDynamic(), NLAIAGENT::CAgentScript::runMethodeMember(), NLAISCRIPT::CCodeContext::Self, and NLAIAGENT::TQueue. Referenced by cancel(), NLAIAGENT::COperatorScript::onFailure(), NLAIAGENT::COperatorScript::onSuccess(), NLAIAGENT::COperatorScript::run(), runMethodBase(), and switchActor().
00150 { 00151 if ( _IsActivated ) 00152 { 00153 CAgentScript *father = (CAgentScript *) getParent(); 00154 if ( father && ( ( CAgentScript *)father)->getClass()->isClassInheritedFrom( CStringVarName("Fsm") ) != -1 ) 00155 { 00156 ( (CFsmScript *)father)->unactivate( this ); 00157 } 00158 00159 static CStringVarName unactivate_func_name("OnUnActivate"); 00160 TQueue r = _AgentClass->isMember( NULL, &unactivate_func_name, NLAISCRIPT::CParam() ); 00161 if ( !r.empty() ) 00162 { 00163 _OnUnActivateIndex = r.top().Index; 00164 const NLAIAGENT::IAgentManager *manager = getAgentManager(); 00165 if ( manager != NULL ) 00166 { 00167 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *) manager->getAgentContext(); 00168 context->Self = this; 00169 runMethodeMember( _OnUnActivateIndex ,context); 00170 _OnActivateIndex = -1; 00171 } 00172 } 00173 // Destroys launched childs? 00174 while ( _Launched.size() ) 00175 { 00176 ( (CActorScript *) _Launched.front() )->cancel(); 00177 //_Launched.front()->Kill(); 00178 /*if(_Launched.front()->getRef() >= 2) 00179 _Launched.front()->release();*/ 00180 removeDynamic(_Launched.front()); 00181 _Launched.front()->release(); 00182 _Launched.pop_front(); 00183 } 00184 onUnActivate(); 00185 _IsActivated = false; 00186 _IsPaused = false; 00187 } 00188 } |
|
Definition at line 92 of file actor_script.h. |
|
|
|
The manager where the agent is run this manager have the agent script context.
Definition at line 170 of file agent_script.h. Referenced by NLAIAGENT::CAgentScript::CAgentScript(), NLAIAGENT::CAgentScript::getAgentManager(), NLAIAGENT::CAgentScript::getDebugString(), NLAIAGENT::CAgentScript::processMessages(), NLAIAGENT::CAgentScript::runActivity(), and NLAIAGENT::CAgentScript::setAgentManager(). |
|
|
Definition at line 427 of file baseai.h. Referenced by NLAIAGENT::IConnectIA::addInConnectedList(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::IConnectIA::removeInConnectedList(), and NLAIAGENT::IConnectIA::save(). |
|
Reimplemented in NLAIAGENT::CAgentOperation. Definition at line 426 of file baseai.h. Referenced by NLAIAGENT::IConnectIA::addInConnectionList(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::IConnectIA::removeInConnectionList(), and NLAIAGENT::IConnectIA::save(). |
|
Map for store agent added in the dynamic child container.
Definition at line 173 of file agent_script.h. Referenced by NLAIAGENT::CAgentScript::addDynamicAgent(), NLAIAGENT::CAgentScript::getDynamicAgent(), NLAIAGENT::CAgentScript::getDynamicName(), NLAIAGENT::CAgentScript::onKill(), NLAIAGENT::CAgentScript::removeDynamic(), NLAIAGENT::CAgentScript::runMethodBase(), NLAIAGENT::CAgentScript::sendBroadCast(), and NLAIAGENT::CAgentScript::sendMessageToDynmaicChild(). |
|
Definition at line 179 of file agent_script.h. Referenced by NLAIAGENT::CAgentScript::CAgentScript(), and NLAIAGENT::CAgentScript::runChildrenStepByStep(). |
|
Definition at line 76 of file actor_script.h. Referenced by CActorScript(). |
|
Definition at line 78 of file actor_script.h. Referenced by CActorScript(), pause(), restart(), and unActivate(). |
|
Definition at line 94 of file actor_script.h. Referenced by Launch(), pause(), restart(), runMethodBase(), unActivate(), and ~CActorScript(). |
|
Box letter for communication service.
Definition at line 63 of file agent.h. Referenced by NLAIAGENT::IBasicAgent::getMail(), NLAIAGENT::IBasicAgent::IBasicAgent(), NLAIAGENT::IBasicAgent::load(), NLAIAGENT::IBasicAgent::onKill(), NLAIAGENT::IBasicAgent::save(), NLAIAGENT::IBasicAgent::sendMessage(), and NLAIAGENT::IBasicAgent::~IBasicAgent(). |
|
Definition at line 88 of file actor_script.h. Referenced by CActorScript(), Launch(), and runMethodBase(). |
|
|
Definition at line 77 of file actor_script.h. |
|
Definition at line 81 of file actor_script.h. Referenced by activate(), CActorScript(), run(), and unActivate(). |
|
Definition at line 86 of file actor_script.h. Referenced by failure(). |
|
Definition at line 83 of file actor_script.h. Referenced by pause(). |
|
Definition at line 84 of file actor_script.h. Referenced by restart(). |
|
Definition at line 85 of file actor_script.h. Referenced by success(). |
|
Definition at line 82 of file actor_script.h. Referenced by CActorScript(), and unActivate(). |
|
Internal state of the agent.
Definition at line 61 of file agent.h. Referenced by NLAIAGENT::IBasicAgent::getState(), and NLAIAGENT::IBasicAgent::setState(). |
|
|
Definition at line 96 of file actor_script.h. Referenced by CActorScript(), getTopLevel(), Launch(), and setTopLevel(). |
|
Referenced by getType(). |
|
Definition at line 77 of file static_def_init.cpp. Referenced by NLAIAGENT::IAgent::getType(). |
|
Referenced by NLAIAGENT::CAgentScript::getType(). |
|
Definition at line 67 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 66 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 181 of file agent_script.h. Referenced by NLAIAGENT::CAgentScript::addSet(), NLAIAGENT::CAgentScript::beginSet(), NLAIAGENT::CAgentScript::CAgentScript(), NLAIAGENT::CAgentScript::endSet(), and NLAIAGENT::CAgentScript::isa(). |
|
Definition at line 63 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 62 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 48 of file actor_script.cpp. Referenced by getPrivateMember(). |
|
Definition at line 71 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 47 of file actor_script.cpp. Referenced by initClass(). |
|
Definition at line 70 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 76 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 72 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 45 of file actor_script.cpp. Referenced by initClass(). |
|
Definition at line 74 of file agent_script.cpp. |
|
Definition at line 77 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 68 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 140 of file agent_script.h. |
|
Definition at line 73 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 46 of file actor_script.cpp. Referenced by getPrivateMember(). |
|
Definition at line 75 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Define the an buzzy state for an agent all time in this state. Definition at line 147 of file baseai.cpp. |
|
Define the an end state for an agent all time in this state. Definition at line 148 of file baseai.cpp. |
|
Define the an error state for an agent all time in this state. Definition at line 149 of file baseai.cpp. |
|
Define the an idle state for an agent all time in this state. Definition at line 145 of file baseai.cpp. |
|
Define the an locked state for an agent all time in this state. Definition at line 146 of file baseai.cpp. |
|
Definition at line 144 of file baseai.cpp. |
|
Definition at line 143 of file baseai.cpp. |
|
Definition at line 65 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Definition at line 64 of file agent_script.cpp. Referenced by NLAIAGENT::CAgentScript::initAgentScript(). |
|
Reimplemented in NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CAgentOperation. Definition at line 69 of file agent_script.cpp. |