示例#1
0
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));
}
示例#2
0
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);
}
示例#3
0
文件: Squad.cpp 项目: rarosu/FnulAI
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();
}