mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
move implementation into cpp file
This commit is contained in:
parent
bbb64f2f8c
commit
67b6dcb49b
@ -93,20 +93,7 @@ public:
|
|||||||
return Priority(this->depth() + other.depth(),
|
return Priority(this->depth() + other.depth(),
|
||||||
this->cost() + other.cost());
|
this->cost() + other.cost());
|
||||||
}
|
}
|
||||||
inline bool operator<(const Priority& other) const {
|
bool operator<(const Priority& other) const;
|
||||||
/* infinite cost should always be last */
|
|
||||||
if (std::isinf(this->cost()) && std::isinf(other.cost()))
|
|
||||||
return this->depth() > other.depth();
|
|
||||||
else if (std::isinf(this->cost()))
|
|
||||||
return false;
|
|
||||||
else if (std::isinf(other.cost()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (this->depth() == other.depth())
|
|
||||||
return this->cost() < other.cost();
|
|
||||||
else
|
|
||||||
return this->depth() > other.depth();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
typedef std::deque<SolutionBase*> Solutions;
|
typedef std::deque<SolutionBase*> Solutions;
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,23 @@ InterfaceState::InterfaceState(const InterfaceState &other)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool InterfaceState::Priority::operator<(const InterfaceState::Priority& other) const {
|
||||||
|
// infinite costs go always last
|
||||||
|
if (std::isinf(this->cost()) && std::isinf(other.cost()))
|
||||||
|
return this->depth() > other.depth();
|
||||||
|
else if (std::isinf(this->cost()))
|
||||||
|
return false;
|
||||||
|
else if (std::isinf(other.cost()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (this->depth() == other.depth())
|
||||||
|
return this->cost() < other.cost();
|
||||||
|
else
|
||||||
|
return this->depth() > other.depth();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Interface::Interface(const Interface::NotifyFunction ¬ify)
|
Interface::Interface(const Interface::NotifyFunction ¬ify)
|
||||||
: notify_(notify)
|
: notify_(notify)
|
||||||
{}
|
{}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user