OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include "AtomSpace_CWrapper.h"
#include <opencog/atomspace/ClassServer.h>
#include <opencog/atomspace/TruthValue.h>
#include <opencog/atomspace/SimpleTruthValue.h>
#include <opencog/atomspace/CountTruthValue.h>
#include <opencog/atomspace/IndefiniteTruthValue.h>
#include <opencog/atomspace/FuzzyTruthValue.h>
#include <opencog/atomspace/ProbabilisticTruthValue.h>
#include <opencog/util/exceptions.h>
Go to the source code of this file.
Functions | |
AtomSpace * | AtomSpace_new (AtomSpace *parent_ptr) |
void | AtomSpace_delete (AtomSpace *this_ptr) |
UUID | AtomSpace_addNode (AtomSpace *this_ptr, const char *type, const char *name) |
UUID | AtomSpace_addLink (AtomSpace *this_ptr, const char *type, const UUID *outgoing, int size) |
UUID | AtomSpace_getNode (AtomSpace *this_ptr, const char *type, const char *name, int *found) |
UUID | AtomSpace_getLink (AtomSpace *this_ptr, const char *type, const UUID *outgoing, int size, int *found) |
int | AtomSpace_removeAtom (AtomSpace *this_ptr, UUID handle) |
int | AtomSpace_getAtomByHandle (AtomSpace *this_ptr, UUID handle, char **type, char **name, UUID **out, int *out_len) |
void | AtomSpace_debug (AtomSpace *this_ptr) |
TruthValueType | AtomSpace_getTruthValue (AtomSpace *this_ptr, UUID handle, double *parameters) |
void | AtomSpace_setTruthValue (AtomSpace *this_ptr, UUID handle, TruthValueType type, double *parameters) |
AtomSpace_addLink Inserts a new link to the atomspace, or updates it if exists.
this_ptr | Pointer to AtomSpace instance. |
type | String representation of a link type. |
outgoing | List of UUID of the outgoing set. |
size | Size of the outgoing list. |
Definition at line 33 of file AtomSpace_CWrapper.cpp.
References opencog::AtomSpace::add_link(), opencog::classserver(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().
AtomSpace_addNode Inserts a new node to the atomspace, or updates it if exists.
this_ptr | Pointer to AtomSpace instance. |
type | String representation of a node type. |
name | Node name. |
Definition at line 22 of file AtomSpace_CWrapper.cpp.
References opencog::AtomSpace::add_node(), opencog::classserver(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().
void AtomSpace_debug | ( | AtomSpace * | this_ptr | ) |
AtomSpace_debug Debug function to print the state of the atomspace on stderr.
this_ptr | Pointer to AtomSpace instance. |
Definition at line 127 of file AtomSpace_CWrapper.cpp.
void AtomSpace_delete | ( | AtomSpace * | this_ptr | ) |
AtomSpace_delete Deletes an AtomSpace object.
this_ptr | Pointer to object. |
Definition at line 17 of file AtomSpace_CWrapper.cpp.
int AtomSpace_getAtomByHandle | ( | AtomSpace * | this_ptr, |
UUID | handle, | ||
char ** | type, | ||
char ** | name, | ||
UUID ** | out, | ||
int * | out_len | ||
) |
AtomSpace_getAtomByHandle Gets an atom back from the atomspace.
this_ptr | Pointer to AtomSpace instance. | |
handle | UUID of the atom. | |
[out] | type | String representation of atom type. |
[out] | name | String representation of atom name (if node). |
[out] | out | List of UUID of the outgoing set (if link). |
[out] | out_len | Size of the outgoing list (if link). |
NOTE: Memory for output parameter is allocated with malloc. The caller should properly free memory in output parameters according to the return value: If node -> free type and name fields. If link -> free type and out field.
Definition at line 86 of file AtomSpace_CWrapper.cpp.
References opencog::classserver(), opencog::Atom::getType(), opencog::ClassServer::getTypeName(), opencog::LinkCast(), and opencog::NodeCast().
UUID AtomSpace_getLink | ( | AtomSpace * | this_ptr, |
const char * | type, | ||
const UUID * | outgoing, | ||
int | size, | ||
int * | found | ||
) |
AtomSpace_getLink Gets a link back from the atomspace.
this_ptr | Pointer to AtomSpace instance. | |
type | String representation of a link type. | |
outgoing | List of UUID of the outgoing set. | |
size | Size of the outgoing list. | |
[out] | found | Flag to know if the link was found. |
Definition at line 62 of file AtomSpace_CWrapper.cpp.
References opencog::classserver(), opencog::AtomSpace::get_link(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().
AtomSpace_getNode Gets a node back from the atomspace.
this_ptr | Pointer to AtomSpace instance. | |
type | String representation of a node type. | |
name | Node name. | |
[out] | found | Flag to know if the node was found. |
Definition at line 48 of file AtomSpace_CWrapper.cpp.
References opencog::classserver(), opencog::AtomSpace::get_node(), opencog::ClassServer::getType(), python.undocumented.blocksworld::t, and opencog::Handle::value().
TruthValueType AtomSpace_getTruthValue | ( | AtomSpace * | this_ptr, |
UUID | handle, | ||
double * | parameters | ||
) |
AtomSpace_getTruthValue Gets the truthvalue of an atom on the atomspace.
this_ptr | Pointer to AtomSpace instance. | |
handle | Handle id of target atom. | |
[out] | parameters | List of parameters of TruthValue result instance. |
Definition at line 132 of file AtomSpace_CWrapper.cpp.
References opencog::COUNT_TRUTH_VALUE, opencog::FUZZY_TRUTH_VALUE, opencog::IndefiniteTruthValue::getMean(), opencog::Atom::getTruthValue(), opencog::INDEFINITE_TRUTH_VALUE, opencog::PROBABILISTIC_TRUTH_VALUE, opencog::SIMPLE_TRUTH_VALUE, and tv.
AtomSpace_new Creates a new instance of the AtomSpace class.
parent_ptr | Pointer to the parent atomspace (null if we want a new independent atomspace). |
Definition at line 12 of file AtomSpace_CWrapper.cpp.
AtomSpace_removeAtom Removes an atom from the atomspace.
this_ptr | Pointer to AtomSpace instance. |
handle | Handle id of the atom to be removed. |
Definition at line 80 of file AtomSpace_CWrapper.cpp.
References opencog::AtomSpace::remove_atom().
void AtomSpace_setTruthValue | ( | AtomSpace * | this_ptr, |
UUID | handle, | ||
TruthValueType | type, | ||
double * | parameters | ||
) |
AtomSpace_setTruthValue Sets the truthvalue of an atom on the atomspace.
this_ptr | Pointer to AtomSpace instance. |
handle | Handle id of target atom. |
type | TruthValue type to be set. |
parameters | List of parameters of TruthValue to be set. |
Definition at line 178 of file AtomSpace_CWrapper.cpp.
References opencog::COUNT_TRUTH_VALUE, opencog::FUZZY_TRUTH_VALUE, opencog::INDEFINITE_TRUTH_VALUE, opencog::PROBABILISTIC_TRUTH_VALUE, opencog::Atom::setTruthValue(), and opencog::SIMPLE_TRUTH_VALUE.