39 this->precondition = precondition;
49 this->effect = effect;
56 obj->setString(
"precondition", precondition);
57 obj->setString(
"effect", effect);
62 obj->setVariant(
"SECPreconditions", preconditionsVariant);
70 obj->setVariant(
"SECEffects", effectsVariant);
75 std::vector<armarx::VariantPtr> relationList;
76 relationList.resize(SECSideConstraints.size());
78 for (
unsigned int i = 0; i < SECSideConstraints.size(); i++)
80 relationList.at(i) =
new armarx::Variant(SECSideConstraints.at(i).relation1);
83 obj->setVariantArray(
"SECSideConstraintsFirstRelations", relationList);
85 for (
unsigned int i = 0; i < SECSideConstraints.size(); i++)
87 relationList.at(i) =
new armarx::Variant(SECSideConstraints.at(i).relation2);
90 obj->setVariantArray(
"SECSideConstraintsSecondRelations", relationList);
97 precondition = obj->getString(
"precondition");
98 effect = obj->getString(
"effect");
100 if (obj->hasElement(
"SECPreconditions") && obj->hasElement(
"SECEffects"))
107 ARMARX_DEBUG_S <<
"No SECEffects/SECPreconditions in OacPredictionFunction in oac segment";
110 std::vector<armarx::VariantPtr> relationList;
111 obj->getVariantArray(
"SECSideConstraintsFirstRelations", relationList);
112 SECSideConstraints.resize(relationList.size());
114 for (
unsigned int i = 0; i < relationList.size(); i++)
116 SECSideConstraints.at(i).relation1 = relationList.at(i)->get<SECRelationBase>();
119 obj->getVariantArray(
"SECSideConstraintsSecondRelations", relationList);
121 for (
unsigned int i = 0; i < relationList.size(); i++)
123 SECSideConstraints.at(i).relation2 = relationList.at(i)->get<SECRelationBase>();
148 SECRelationPairList pairList;
150 for (
unsigned int i = 0; i < pairListOrig.size(); i++)
152 SECRelationPair newPair;
154 if (pairListOrig.at(i).relation1)
156 newPair.relation1 = SECRelationBasePtr::dynamicCast(pairListOrig.at(i).relation1->ice_clone());
159 if (pairListOrig.at(i).relation2)
161 newPair.relation2 = SECRelationBasePtr::dynamicCast(pairListOrig.at(i).relation2->ice_clone());
164 pairList.push_back(newPair);
167 clone->setSECSideConstraints(pairList);
174 return "OacPredictionFunction";
185 return SECPreconditions;
190 SECPreconditions = preconditions;
200 SECEffects = effects;
206 return SECSideConstraints;
211 SECSideConstraints = sideConstraints;