26 #include "../../../../core/entity/EntityRef.h"
31 const std::string PredictionEntity::SNAPSHOT_ATTRIBUTE(
"memorySnapshot");
32 const std::string PredictionEntity::SOURCE_SNAPSHOT_ATTRIBUTE(
"sourceMemorySnapshot");
33 const std::string PredictionEntity::PREDICTION_ATTRIBUTE(
"predictedMemorySnapshot");
34 const std::string PredictionEntity::PREDICTION_LIST_ATTRIBUTE(
"predictedMemorySnapshotList");
35 const std::string PredictionEntity::PREDICTION_METHOD_NAME_ATTRIBUTE(
"predictionMethodName");
36 const std::string PredictionEntity::TASK_COUNT_ATTRIBUTE(
"taskCount");
37 const std::string PredictionEntity::PREDICTION_SCORE_ATTRIBUTE(
"predictionScore");
45 PredictionEntity::PredictionEntity(
const EntityRefBasePtr& memorySnapshotRef,
const EntityRefBasePtr& sourceMemorySnapshotRef,
const EntityRefBasePtr& predictedMemorySnapshotRef,
const EntityRefBaseList& predictedMemorySnapshotRefList,
const std::string& predictionMethodName,
Ice::Int taskCount,
Ice::Float predictionScore) :
63 PredictionEntityBase(
source),
85 void PredictionEntity::output(std::ostream& stream)
const
137 EntityAttributeBasePtr attribute =
getAttribute(PredictionEntity::PREDICTION_LIST_ATTRIBUTE);
138 EntityRefBaseList entityList;
139 for (
int i = 0; i < attribute->size(); i++)
141 armarx::VariantPtr attributeValue = armarx::VariantPtr::dynamicCast(attribute->getValueAt(i));
142 entityList.push_back(attributeValue->get<
EntityRef>());
149 EntityAttributeBasePtr attribute =
getAttribute(PredictionEntity::PREDICTION_LIST_ATTRIBUTE);
151 for (
const EntityRefBasePtr& entityRef : predictedMemorySnapshotRefList)
159 return getAttribute(PredictionEntity::PREDICTION_METHOD_NAME_ATTRIBUTE)->getValue()->getString();
179 return getAttributeValue(PredictionEntity::PREDICTION_SCORE_ATTRIBUTE)->getFloat();