OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::EvaluationLink Class Reference

#include <EvaluationLink.h>

+ Inheritance diagram for opencog::EvaluationLink:
+ Collaboration diagram for opencog::EvaluationLink:

Public Member Functions

 EvaluationLink (const HandleSeq &oset, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 EvaluationLink (Handle schema, Handle args, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 EvaluationLink (Link &l)
 
TruthValuePtr evaluate (AtomSpace *as)
 
- Public Member Functions inherited from opencog::Atom
virtual ~Atom ()
 
Type getType () const
 
bool isType (Type t, bool subclass) const
 
Handle getHandle ()
 
AttentionValuePtr getAttentionValue ()
 
void setAttentionValue (AttentionValuePtr)
 Sets the AttentionValue object of the atom. More...
 
AttentionValue::sti_t getSTI ()
 Handy-dandy convenience getters for attention values. More...
 
AttentionValue::lti_t getLTI ()
 
AttentionValue::vlti_t getVLTI ()
 
void setSTI (AttentionValue::sti_t stiValue)
 
void setLTI (AttentionValue::lti_t ltiValue)
 
void incVLTI ()
 
void decVLTI ()
 
TruthValuePtr getTruthValue ()
 
void setTruthValue (TruthValuePtr)
 Sets the TruthValue object of the atom. More...
 
void merge (TruthValuePtr)
 
Handle tvmerge (TruthValuePtr tv)
 
size_t getIncomingSetSize ()
 Get the size of the incoming set. More...
 
IncomingSet getIncomingSet ()
 
template<typename OutputIterator >
OutputIterator getIncomingSet (OutputIterator result)
 
template<class T >
bool foreach_incoming (bool(T::*cb)(const Handle &), T *data)
 
template<typename OutputIterator >
OutputIterator getIncomingSetByType (OutputIterator result, Type type, bool subclass=false)
 
IncomingSet getIncomingSetByType (Type type, bool subclass=false)
 

Static Public Member Functions

static TruthValuePtr do_evaluate (AtomSpace *, Handle)
 
static TruthValuePtr do_evaluate (AtomSpace *, const HandleSeq &schema_and_args)
 
static TruthValuePtr do_evaluate (AtomSpace *, Handle schema, Handle args)
 

Additional Inherited Members

- Protected Types inherited from opencog::Atom
typedef std::shared_ptr< InSetInSetPtr
 
- Protected Member Functions inherited from opencog::Atom
 Atom (Type t, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
void keep_incoming_set ()
 
void drop_incoming_set ()
 
void insert_atom (LinkPtr)
 Add an atom to the incoming set. More...
 
void remove_atom (LinkPtr)
 Remove an atom from the incoming set. More...
 
- Protected Attributes inherited from opencog::Atom
UUID _uuid
 
AtomTable_atomTable
 
Type _type
 
char _flags
 
TruthValuePtr _truthValue
 
AttentionValuePtr _attentionValue
 
std::mutex _mtx
 
InSetPtr _incoming_set
 

Detailed Description

Definition at line 35 of file EvaluationLink.h.

Constructor & Destructor Documentation

EvaluationLink::EvaluationLink ( const HandleSeq oset,
TruthValuePtr  tv = TruthValue::NULL_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)

Definition at line 34 of file EvaluationLink.cc.

References opencog::Atom::getType().

EvaluationLink::EvaluationLink ( Handle  schema,
Handle  args,
TruthValuePtr  tv = TruthValue::NULL_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)

Definition at line 47 of file EvaluationLink.cc.

References opencog::Atom::getType().

EvaluationLink::EvaluationLink ( Link l)

Definition at line 58 of file EvaluationLink.cc.

References opencog::Atom::getType().

Member Function Documentation

TruthValuePtr EvaluationLink::do_evaluate ( AtomSpace as,
Handle  execlnk 
)
static

do_evaluate – evaluate the GroundedPredicateNode of the EvaluationLink

Expects the argument to be an EvaluationLink, which should have the following structure:

EvaluationLink
    GroundedPredicateNode "lang: func_name"
    ListLink
        SomeAtom
        OtherAtom

The "lang:" should be either "scm:" for scheme, or "py:" for python. This method will then invoke "func_name" on the provided ListLink of arguments to the function.

Definition at line 127 of file EvaluationLink.cc.

References opencog::SimpleTruthValue::createTV(), equal(), opencog::Atom::getType(), greater(), opencog::LinkCast(), python.undocumented.blocksworld::t, and tv.

+ Here is the caller graph for this function:

TruthValuePtr EvaluationLink::do_evaluate ( AtomSpace as,
const HandleSeq sna 
)
static

do_evaluate – evaluate the GroundedPredicateNode of the EvaluationLink

Expects the sequence to be exactly two atoms long. Expects the first handle of the sequence to be a GroundedPredicateNode Expects the second handle of the sequence to be a ListLink Executes the GroundedPredicateNode, supplying the second handle as argument

Definition at line 160 of file EvaluationLink.cc.

References do_evaluate().

TruthValuePtr EvaluationLink::do_evaluate ( AtomSpace as,
Handle  gsn,
Handle  args 
)
static

do_evaluate – evaluate the GroundedPredicateNode of the EvaluationLink

Expects "gsn" to be a GroundedPredicateNode Expects "args" to be a ListLink Executes the GroundedPredicateNode, supplying the args as argument

Definition at line 176 of file EvaluationLink.cc.

References opencog::SchemeEval::apply_tv(), opencog::PythonEval::apply_tv(), benchmark::args, opencog::TruthValue::FALSE_TV(), opencog::SchemeEval::get_evaluator(), opencog::Atom::getType(), greater(), opencog::PythonEval::instance(), opencog::LinkCast(), opencog::NodeCast(), and opencog::TruthValue::TRUE_TV().

TruthValuePtr opencog::EvaluationLink::evaluate ( AtomSpace as)
inline

Definition at line 48 of file EvaluationLink.h.

References do_evaluate(), and opencog::Atom::Handle.


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