23 #ifndef _OPENCOG_NUMBER_NODE_H
24 #define _OPENCOG_NUMBER_NODE_H
49 :
Node(NUMBER_NODE, std::to_string(std::stod(s)),
tv,
av),
56 :
Node(NUMBER_NODE, std::to_string(vvv),
tv,
av),
61 :
Node(NUMBER_NODE, std::to_string(std::stod(n.
getName())),
65 OC_ASSERT(NUMBER_NODE == n.
getType(),
"Bad NumberNode constructor!");
68 static std::string
validate(
const std::string& str)
70 return std::to_string(std::stod(str));
80 {
return std::dynamic_pointer_cast<
NumberNode>(
a); }
83 #define createNumberNode std::make_shared<NumberNode>
88 #endif // _OPENCOG_NUMBER_NODE_H
AttentionValuePtr getAttentionValue()
NumberNode(const std::string &s, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
std::shared_ptr< Atom > AtomPtr
static std::string validate(const std::string &str)
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
std::shared_ptr< NumberNode > NumberNodePtr
const std::string & getName() const
static TruthValuePtr DEFAULT_TV()
static NumberNodePtr NumberNodeCast(const Handle &h)
static AttentionValuePtr DEFAULT_AV()
to be used as default attention value
TruthValuePtr getTruthValue()
NumberNode(double vvv, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())