14 using CostStack = CostStackTpl<Scalar>;
15 using CostStackData = CostStackDataTpl<Scalar>;
17 bp::class_<CostStack, bp::bases<CostAbstract>>(
18 "CostStack",
"A weighted sum of other cost functions.",
19 bp::init<shared_ptr<Manifold>, int,
20 const std::vector<shared_ptr<CostAbstract>> &,
21 const std::vector<Scalar> &>((
"self"_a,
"space",
"nu",
22 "components"_a = bp::list(),
23 "weights"_a = bp::list())))
24 .def_readwrite(
"components", &CostStack::components_,
25 "Components of this cost stack.")
26 .def_readonly(
"weights", &CostStack::weights_,
27 "Weights of this cost stack.")
28 .def(
"addCost", &CostStack::addCost, (
"self"_a,
"cost",
"weight"_a = 1.),
29 "Add a cost to the stack of costs.")
30 .def(
"size", &CostStack::size,
"Get the number of cost components.")
31 .def(CopyableVisitor<CostStack>());
33 bp::register_ptr_to_python<shared_ptr<CostStackData>>();
34 bp::class_<CostStackData, bp::bases<CostData>>(
35 "CostStackData",
"Data struct for CostStack.", bp::no_init)
36 .def_readonly(
"sub_cost_data", &CostStackData::sub_cost_data);
CostAbstractTpl< Scalar > CostAbstract
ManifoldAbstractTpl< Scalar > Manifold
CostDataAbstractTpl< Scalar > CostData