34 #include "opencog/atomspace/CompositeTruthValue.h"
38 #include "VersionHandle.h"
40 using namespace opencog;
67 HandleEntry *previous = atom.incoming;
70 HandleEntry *current =
new HandleEntry(
Handle(atomMessage.
incoming(i)));
71 previous->next = current;
76 atom.type = atomMessage.
type();
77 atom.flags = atomMessage.
flags();
89 HandleEntry* next=atom.incoming;
119 throw RuntimeException(TRACE_INFO,
"Invalid ZMQ atomtype");
134 throw RuntimeException(TRACE_INFO,
"Invalid atomtype");
142 av.
m_STI=attentionValueHolderMessage.
sti();
143 av.
m_LTI=attentionValueHolderMessage.
lti();
157 AttentionValueHolder& avh )
178 tv.versionedTVs[vh] =
deserialize(singleTruthValue);
185 serialize(*(tv.primaryTV), truthValueMessage);
187 for (VersionedTruthValueMap::const_iterator itr = tv.versionedTVs.begin();itr != tv.versionedTVs.end(); ++itr)
189 serialize(*(itr->second), truthValueMessage);
190 VersionHandle vh = itr->first;
217 tv.
L=singleTruthValue.
l();
218 tv.
U=singleTruthValue.
u();
238 singleTruthValue->
set_l(tv.
L);
239 singleTruthValue->
set_u(tv.
U);
266 link.trail=
new Trail();
271 void ProtocolBufferSerializer::serializeLink(
278 for (
Handle h : link.outgoing)
290 node.name=atomMessage.
name();
329 t.maxSize=trailMessage.
maxsize();
336 t.trail =
new std::deque<Handle>(trailMessage.
trail_size());
345 for (
Handle h : *(t.trail))
379 throw RuntimeException(TRACE_INFO,
"Invalid truthvaluetype.");
389 CompositeTruthValue*
tv =
new CompositeTruthValue();
424 throw RuntimeException(TRACE_INFO,
"Invalid ZMQ truthvaluetype: '%d'.",
432 vh.indicator=(IndicatorType)versionHandleMessage.
indicator();
float confidencelevel() const
static void deserializeIndefiniteTruthValue(const ZMQSingleTruthValueMessage &singleTruthValue, IndefiniteTruthValue &tv)
inline::google::protobuf::int32 flags() const
void set_indicator(::google::protobuf::uint32 value)
const ::ZMQTrailMessage & trail() const
inline::google::protobuf::int32 type() const
void set_confidencelevel(float value)
count_t count
Total number of observations used to estimate the mean.
a TruthValue that stores a mean and the number of observations (strength and confidence) ...
inline::google::protobuf::int32 maxsize() const
void set_truthvaluetype(ZMQTruthValueType value)
ProtocolBufferSerializer()
inline::ZMQSingleTruthValueMessage * add_singletruthvalue()
const ::ZMQTruthValueMessage & truthvalue() const
inline::google::protobuf::uint64 incoming(int index) const
int outgoing_size() const
void set_substantive(::google::protobuf::uint64 value)
static void deserializeLink(const ZMQAtomMessage &atomMessage, Link &link)
inline::google::protobuf::uint64 trail(int index) const
inline::ZMQSingleTruthValueMessage * mutable_singletruthvalue(int index)
void set_handle(::google::protobuf::uint64 value)
ZMQTruthValueType truthvaluetype() const
ZMQAtomType atomtype() const
std::vector< strength_t * > firstOrderDistribution
float firstorderdistribution(int index) const
inline::google::protobuf::int32 sti() const
void set_symmetric(::google::protobuf::int32 value)
void set_mean(float value)
static void deserializeSimpleTruthValue(const ZMQSingleTruthValueMessage &singleTruthValue, SimpleTruthValue &tv)
void add_firstorderdistribution(float value)
inline::google::protobuf::uint64 handle() const
void set_name(const ::std::string &value)
void set_lti(::google::protobuf::int32 value)
int firstorderdistribution_size() const
inline::google::protobuf::uint32 indicator() const
void add_incoming(::google::protobuf::uint64 value)
void set_type(::google::protobuf::int32 value)
void set_diff(float value)
sti_t m_STI
short-term importance
void set_confidence(float value)
static void serializeNullTruthValue(NullTruthValue &tv, ZMQTruthValueMessage *truthValueMessage)
static void deserializeAttentionValue(const ZMQAttentionValueHolderMessage &attentionValueHolderMessage, AttentionValue &av)
static void deserializeTrail(const ZMQTrailMessage &trailMessage, Trail &trail)
static void deserializeAtom(const ZMQAtomMessage &atomMessage, Atom &atom)
static void serialize(Atom &atom, ZMQAtomMessage *atomMessage)
inline::ZMQAttentionValueHolderMessage * mutable_attentionvalueholder()
a special type of TruthValue
static void serializeAttentionValueHolder(AttentionValueHolder &attentionValueHolder, ZMQAttentionValueHolderMessage *attentionValueHolderMessage)
static void serializeAttentionValue(AttentionValue &av, ZMQAttentionValueHolderMessage *attentionValueHolderMessage)
static void serializeVersionHandle(VersionHandle &vh, ZMQVersionHandleMessage *versionHandleMessage)
void set_maxsize(::google::protobuf::int32 value)
void set_vlti(::google::protobuf::int32 value)
inline::google::protobuf::int32 lti() const
static void deserializeVersionHandle(const ZMQVersionHandleMessage &versionHandleMessage, VersionHandle &vh)
confidence_t confidenceLevel
referred as "b" in the paper
int singletruthvalue_size() const
void add_outgoing(::google::protobuf::uint64 value)
static void serializeIndefiniteTruthValue(IndefiniteTruthValue &tv, ZMQTruthValueMessage *truthValueMessage)
inline::ZMQTruthValueMessage * mutable_truthvalue()
inline::google::protobuf::uint64 substantive() const
static void deserializeAttentionValueHolder(const ZMQAttentionValueHolderMessage &attentionValueHolderMessage, AttentionValueHolder &attentionValueHolder)
void add_trail(::google::protobuf::uint64 value)
static TruthValue * deserialize(const ZMQSingleTruthValueMessage &singleTruthValueMessage)
static void serializeLink(Link &link, ZMQAtomMessage *atomMessage)
inline::google::protobuf::int32 symmetric() const
static void serializeAtom(Atom &atom, ZMQAtomMessage *atomMessage)
static void deserializeNode(const ZMQAtomMessage &atomMessage, Node &node)
inline::google::protobuf::int32 vlti() const
const ::ZMQAttentionValueHolderMessage & attentionvalueholder() const
static void serializeCompositeTruthValue(CompositeTruthValue &tv, ZMQTruthValueMessage *truthValueMessage)
~ProtocolBufferSerializer()
void set_count(float value)
void set_flags(::google::protobuf::int32 value)
a TruthValue that stores a mean, a confidence and the number of observations
static void serializeCountTruthValue(CountTruthValue &tv, ZMQTruthValueMessage *truthValueMessage)
static void serializeNode(Node &node, ZMQAtomMessage *atomMessage)
int incoming_size() const
const ::ZMQSingleTruthValueMessage & singletruthvalue(int index) const
static void serializeTrail(Trail &trail, ZMQTrailMessage *trailMessage)
inline::google::protobuf::uint64 outgoing(int index) const
static void serializeSimpleTruthValue(SimpleTruthValue &tv, ZMQTruthValueMessage *truthValueMessage)
void set_sti(::google::protobuf::int32 value)
static void deserializeCountTruthValue(const ZMQSingleTruthValueMessage &singleTruthValue, CountTruthValue &tv)
inline::ZMQTrailMessage * mutable_trail()
lti_t m_LTI
long-term importance
const ::ZMQVersionHandleMessage & versionhandle() const
strength_t mean
Mean of the strength of the TV over all observations.
static void deserializeCompositeTruthValue(const ZMQTruthValueMessage &truthValueMessage, CompositeTruthValue &tv)
void set_atomtype(ZMQAtomType value)
const ::std::string & name() const