void ompl::base::ProblemDefinition::setGoalState(const State *goal, const double threshold) { clearGoal(); auto *gs = new GoalState(si_); gs->setState(goal); gs->setThreshold(threshold); setGoal(GoalPtr(gs)); }
void ompl::base::ProblemDefinition::setGoalState(const State *goal, const double threshold) { clearGoal(); auto gs(std::make_shared<GoalState>(si_)); gs->setState(goal); gs->setThreshold(threshold); setGoal(gs); }
void Squad::computeActions() { if (!active) { if (isFull()) { active = true; } } if (active) { int noAlive = 0; int noDead = 0; for (int i = 0; i < (int)agents.size(); i++) { if (agents.at(i)->isAlive()) { noAlive++; } if (!agents.at(i)->isAlive()) { noDead++; } } if ((int)agents.size() > 0) { if (noAlive <= ((int)agents.size() / 10)) { noAlive = 0; } } if (noAlive == 0) { active = false; clearGoal(); return; } } if (active) { if (activePriority != priority) { priority = activePriority; } } checkAttack(); }