# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLAILOGIC::CFirstOrderOperator Class Reference

#include <fo_operator.h>

Inheritance diagram for NLAILOGIC::CFirstOrderOperator:

NLAILOGIC::IBaseOperator NLAILOGIC::IBaseBoolType NLAIAGENT::IObjetOp NLAIAGENT::IObjectIA NLAIAGENT::IBasicObjectIA NLAIC::IBasicInterface NLAIC::IBasicType NLAIC::IPointerGestion NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 CFirstOrderOperator ()
 CFirstOrderOperator (const CFirstOrderOperator &)
 ~CFirstOrderOperator ()
std::list< CFactPattern * > * forward (CFactPattern *)
 Gives the postcondition for a CFact in the preconditions. More...

std::list< CFactPattern * > * backward (CFactPattern *)
 Gives the precondition for a CFact in the postconditions. More...

void addPrecondition (CFactPattern *)
 Adds a first order logic precondition to the operator. More...

void addPostcondition (CFactPattern *)
 Adds a first order logic postcondition to the operator. More...

std::list< CFact * > * backward (std::list< CFact * > &)
 Returns the result of backarding a list of facts through the operator. More...

std::list< CFact * > * forward (std::list< CFact * > &)
 Returns the conclusions of the operator for given preconditions facts. More...

std::list< CFact * > * propagate (std::list< CFact * > &)
 Propagates facts through the operator and network of asserts/ operators. More...

virtual const NLAIC::IBasicTypeclone () const
 This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne. More...

virtual const NLAIC::IBasicTypenewInstance () const
 This function allow a new instance, that mean that the class is a class factory. More...

virtual void save (NLMISC::IStream &os)
 Save the class in a stream. More...

virtual void load (NLMISC::IStream &is)
 Load the class from a stream. More...

virtual void getDebugString (std::string &) const
 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. More...

virtual bool isEqual (const CFirstOrderOperator &a) const
virtual const NLAIAGENT::IObjectIA::CProcessResultrun ()
 Some where Run method define the process of the agen. More...

bool isEqual (const NLAIAGENT::IBasicObjectIA &a) const
const NLAIC::CIdentTypegetType () const
 getType return a unique string how represente the class, it can be the name of the class. More...

virtual bool operator== (CFirstOrderOperator *)
std::list< CFact * > * test (std::list< CFact * > &)
virtual bool isTrue () const
 Returns true if the preconditions are validated. More...

virtual float truthValue () const
 Returns a value in [0,1]. More...

virtual bool isValid (CFactBase *)
 Asks wether the operator's preconditions are validated,. More...

virtual float priority () const
 Priority of the operator. More...

virtual void success ()
 Own success and failure functions These function telle other operators and goals that might be waiting for the execution of this one. More...

virtual void failure ()
virtual void success (IBaseOperator *)
 Dependencies failure and success notification These functions are called by other operators or goals who failed or succeeded. More...

virtual void failure (IBaseOperator *)

Static Public Attributes

const NLAIC::CIdentType IdCFirstOrderOperator

Protected Methods

void compileFactPattern (CFactPattern *, std::vector< IBaseAssert * > &, std::vector< sint32 > &)
 Pos of a postcondition pattern's vars in the operator's vars tableTransforms a CFactPattern in an assert and a list of variable positions in the operator. More...

sint32 CFirstOrderOperator::getVarPos (IBaseVar *var)
 Returns the pos of a vraiables in the operator's vars table, -1 if not found. More...

void getPosListForward (sint32, sint32, std::vector< sint32 > &)
void getPosListBackward (sint32, sint32, std::vector< sint32 > &)
void getAssertPos (IBaseAssert *, std::vector< IBaseAssert * > &, std::vector< sint32 > &)
CValueSetunifyBackward (std::list< CFact * > &)
CValueSetunifyForward (std::list< CFact * > &)
CFactbuildFromVars (IBaseAssert *, std::vector< sint32 > &, CValueSet *)
std::list< CValueSet * > * propagate (std::list< CValueSet * > &, CValueSet *, std::vector< sint32 > &)
 Forward chaining. More...

CValueSetunifyLiaison (const CValueSet *, CValueSet *, std::vector< sint32 > &)
 Tries to unify an instaciation of the operator's variables with a new CFact. More...


Protected Attributes

std::vector< IBaseVar * > _Vars
std::vector< std::vector<
sint32 > > 
_PosVarsCond
 Variables of the operator. More...

std::vector< std::vector<
sint32 > > 
_PosVarsConc
 Pos of a precondition pattern's vars in the operator's vars table. More...


Constructor & Destructor Documentation

NLAILOGIC::CFirstOrderOperator::CFirstOrderOperator  
 

Definition at line 35 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Comment.

Referenced by clone, and newInstance.

NLAILOGIC::CFirstOrderOperator::CFirstOrderOperator const CFirstOrderOperator &   
 

Definition at line 40 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Comment, NLAILOGIC::IBaseOperator::_Concs, NLAILOGIC::IBaseOperator::_Conds, _PosVarsConc, and _PosVarsCond.

NLAILOGIC::CFirstOrderOperator::~CFirstOrderOperator  
 

Definition at line 109 of file fo_operator.cpp.

References _Vars.


Member Function Documentation

void NLAILOGIC::CFirstOrderOperator::addPostcondition CFactPattern  
 

Adds a first order logic postcondition to the operator.

Definition at line 159 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Concs, NLAILOGIC::IBaseOperator::_Conds, _PosVarsConc, and compileFactPattern.

void NLAILOGIC::CFirstOrderOperator::addPrecondition CFactPattern  
 

Adds a first order logic precondition to the operator.

Definition at line 145 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Conds, _PosVarsCond, and compileFactPattern.

std::list< CFact * > * NLAILOGIC::CFirstOrderOperator::backward std::list< CFact * > &    [virtual]
 

Returns the result of backarding a list of facts through the operator.

Implements NLAILOGIC::IBaseOperator.

Definition at line 313 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Conds, _PosVarsCond, buildFromVars, and unifyBackward.

std::list<CFactPattern *>* NLAILOGIC::CFirstOrderOperator::backward CFactPattern  
 

Gives the precondition for a CFact in the postconditions.

Referenced by test.

CFact * NLAILOGIC::CFirstOrderOperator::buildFromVars IBaseAssert  ,
std::vector< sint32 > &   ,
CValueSet  
[protected]
 

Definition at line 303 of file fo_operator.cpp.

References assert.

Referenced by backward, forward, and propagate.

sint32 NLAILOGIC::CFirstOrderOperator::CFirstOrderOperator::getVarPos IBaseVar   var [protected]
 

Returns the pos of a vraiables in the operator's vars table, -1 if not found.

const NLAIC::IBasicType * NLAILOGIC::CFirstOrderOperator::clone   const [virtual]
 

This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne.

Implements NLAIC::IBasicType.

Definition at line 486 of file fo_operator.cpp.

References CFirstOrderOperator, and clone.

Referenced by clone.

void NLAILOGIC::CFirstOrderOperator::compileFactPattern CFactPattern  ,
std::vector< IBaseAssert * > &   ,
std::vector< sint32 > &   
[protected]
 

Pos of a postcondition pattern's vars in the operator's vars tableTransforms a CFactPattern in an assert and a list of variable positions in the operator.

Definition at line 115 of file fo_operator.cpp.

References _Vars.

Referenced by addPostcondition, and addPrecondition.

void NLAILOGIC::CFirstOrderOperator::failure IBaseOperator   [virtual]
 

Implements NLAILOGIC::IBaseOperator.

Definition at line 644 of file fo_operator.cpp.

void NLAILOGIC::CFirstOrderOperator::failure   [virtual]
 

Implements NLAILOGIC::IBaseOperator.

Definition at line 636 of file fo_operator.cpp.

std::list< CFact * > * NLAILOGIC::CFirstOrderOperator::forward std::list< CFact * > &    [virtual]
 

Returns the conclusions of the operator for given preconditions facts.

Implements NLAILOGIC::IBaseOperator.

Definition at line 330 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Concs, _PosVarsConc, buildFromVars, and unifyForward.

std::list< CFactPattern * > * NLAILOGIC::CFirstOrderOperator::forward CFactPattern  
 

Gives the postcondition for a CFact in the preconditions.

Definition at line 220 of file fo_operator.cpp.

void NLAILOGIC::CFirstOrderOperator::getAssertPos IBaseAssert  ,
std::vector< IBaseAssert * > &   ,
std::vector< sint32 > &   
[protected]
 

Definition at line 211 of file fo_operator.cpp.

References NLAISCRIPT::l.

Referenced by propagate, unifyBackward, and unifyForward.

void NLAILOGIC::CFirstOrderOperator::getDebugString std::string &    const [virtual]
 

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.

Implements NLAIC::IBasicType.

Definition at line 506 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Comment, NLAILOGIC::IBaseOperator::_Concs, NLAILOGIC::IBaseOperator::_Conds, _PosVarsConc, _PosVarsCond, and _Vars.

void NLAILOGIC::CFirstOrderOperator::getPosListBackward sint32   ,
sint32   ,
std::vector< sint32 > &   
[protected]
 

Definition at line 174 of file fo_operator.cpp.

References _PosVarsConc, and _PosVarsCond.

void NLAILOGIC::CFirstOrderOperator::getPosListForward sint32   ,
sint32   ,
std::vector< sint32 > &   
[protected]
 

Definition at line 193 of file fo_operator.cpp.

References _PosVarsConc, and _PosVarsCond.

const NLAIC::CIdentType & NLAILOGIC::CFirstOrderOperator::getType   const [virtual]
 

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).

Implements NLAIC::IBasicType.

Definition at line 575 of file fo_operator.cpp.

References IdCFirstOrderOperator.

bool NLAILOGIC::CFirstOrderOperator::isEqual const NLAIAGENT::IBasicObjectIA   a const
 

Definition at line 565 of file fo_operator.cpp.

bool NLAILOGIC::CFirstOrderOperator::isEqual const CFirstOrderOperator &    a const [virtual]
 

Definition at line 555 of file fo_operator.cpp.

bool NLAILOGIC::CFirstOrderOperator::isTrue   const [virtual]
 

Returns true if the preconditions are validated.

Implements NLAIAGENT::IObjetOp.

Definition at line 570 of file fo_operator.cpp.

bool NLAILOGIC::CFirstOrderOperator::isValid CFactBase   [virtual]
 

Asks wether the operator's preconditions are validated,.

Implements NLAILOGIC::IBaseOperator.

Definition at line 591 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Conds, propagate, and res.

void NLAILOGIC::CFirstOrderOperator::load NLMISC::IStream   is [virtual]
 

Load the class from a stream.

Reimplemented from NLAILOGIC::IBaseOperator.

Definition at line 502 of file fo_operator.cpp.

const NLAIC::IBasicType * NLAILOGIC::CFirstOrderOperator::newInstance   const [virtual]
 

This function allow a new instance, that mean that the class is a class factory.

Implements NLAIC::IBasicType.

Definition at line 492 of file fo_operator.cpp.

References CFirstOrderOperator.

bool NLAILOGIC::CFirstOrderOperator::operator== CFirstOrderOperator *    [virtual]
 

Definition at line 580 of file fo_operator.cpp.

float NLAILOGIC::CFirstOrderOperator::priority   const [virtual]
 

Priority of the operator.

Implements NLAILOGIC::IBaseOperator.

Definition at line 627 of file fo_operator.cpp.

std::list< CFact * > * NLAILOGIC::CFirstOrderOperator::propagate std::list< CFact * > &    [virtual]
 

Propagates facts through the operator and network of asserts/ operators.

Implements NLAILOGIC::IBaseOperator.

Definition at line 355 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Concs, NLAILOGIC::IBaseOperator::_Conds, _PosVarsConc, _PosVarsCond, _Vars, buildFromVars, getAssertPos, propagate, and r.

std::list< CValueSet * > * NLAILOGIC::CFirstOrderOperator::propagate std::list< CValueSet * > &   ,
CValueSet  ,
std::vector< sint32 > &   
[protected]
 

Forward chaining.

Definition at line 429 of file fo_operator.cpp.

References NLAISCRIPT::l, and unifyLiaison.

Referenced by isValid, and propagate.

const IObjectIA::CProcessResult & NLAILOGIC::CFirstOrderOperator::run   [virtual]
 

Some where Run method define the process of the agen.

Implements NLAILOGIC::IBaseBoolType.

Definition at line 560 of file fo_operator.cpp.

void NLAILOGIC::CFirstOrderOperator::save NLMISC::IStream   os [virtual]
 

Save the class in a stream.

Reimplemented from NLAILOGIC::IBaseOperator.

Definition at line 498 of file fo_operator.cpp.

void NLAILOGIC::CFirstOrderOperator::success IBaseOperator   [virtual]
 

Dependencies failure and success notification These functions are called by other operators or goals who failed or succeeded.

Implements NLAILOGIC::IBaseOperator.

Definition at line 640 of file fo_operator.cpp.

void NLAILOGIC::CFirstOrderOperator::success   [virtual]
 

Own success and failure functions These function telle other operators and goals that might be waiting for the execution of this one.

Implements NLAILOGIC::IBaseOperator.

Definition at line 632 of file fo_operator.cpp.

std::list< CFact * > * NLAILOGIC::CFirstOrderOperator::test std::list< CFact * > &    [virtual]
 

Reimplemented from NLAILOGIC::IBaseOperator.

Definition at line 472 of file fo_operator.cpp.

References backward.

float NLAILOGIC::CFirstOrderOperator::truthValue   const [virtual]
 

Returns a value in [0,1].

Implements NLAILOGIC::IBaseBoolType.

Definition at line 585 of file fo_operator.cpp.

CValueSet * NLAILOGIC::CFirstOrderOperator::unifyBackward std::list< CFact * > &    [protected]
 

Definition at line 225 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Concs, _PosVarsConc, _Vars, getAssertPos, and NLAIAGENT::IObjectIA::IObjectIA.

Referenced by backward.

CValueSet * NLAILOGIC::CFirstOrderOperator::unifyForward std::list< CFact * > &    [protected]
 

Definition at line 264 of file fo_operator.cpp.

References NLAILOGIC::IBaseOperator::_Conds, _PosVarsCond, _Vars, getAssertPos, and NLAIAGENT::IObjectIA::IObjectIA.

Referenced by forward.

CValueSet * NLAILOGIC::CFirstOrderOperator::unifyLiaison const CValueSet  ,
CValueSet  ,
std::vector< sint32 > &   
[protected]
 

Tries to unify an instaciation of the operator's variables with a new CFact.

Definition at line 416 of file fo_operator.cpp.

Referenced by propagate.


Member Data Documentation

std::vector< std::vector<sint32> > NLAILOGIC::CFirstOrderOperator::_PosVarsConc [protected]
 

Pos of a precondition pattern's vars in the operator's vars table.

Definition at line 46 of file fo_operator.h.

Referenced by addPostcondition, CFirstOrderOperator, forward, getDebugString, getPosListBackward, getPosListForward, propagate, and unifyBackward.

std::vector< std::vector<sint32> > NLAILOGIC::CFirstOrderOperator::_PosVarsCond [protected]
 

Variables of the operator.

Definition at line 45 of file fo_operator.h.

Referenced by addPrecondition, backward, CFirstOrderOperator, getDebugString, getPosListBackward, getPosListForward, propagate, and unifyForward.

std::vector<IBaseVar *> NLAILOGIC::CFirstOrderOperator::_Vars [protected]
 

Definition at line 44 of file fo_operator.h.

Referenced by compileFactPattern, getDebugString, propagate, unifyBackward, unifyForward, and ~CFirstOrderOperator.

const NLAIC::CIdentType CFirstOrderOperator::IdCFirstOrderOperator [static]
 

Initial value:

Definition at line 521 of file static_def_init.cpp.

Referenced by getType.


The documentation for this class was generated from the following files: