sim/goal/AntFindFood.cpp
// Checks the current node's edges for pheromones. If found, the node that
// the pheromone points to is returned. Otherwise, nullptr is returned.
Checks the current node's edges for pheromones. If found, the node that
the pheromone points to is returned. Otherwise, nullptr is returned.
Checks the current node ' s edges for pheromones . If found the node that the pheromone points to is returned . Otherwise nullptr is returned .
Node* AntFindFood::checkEdgesForPheromone(Node& currentNode)
{
	Node* mostRecentNode = nullptr;
	uint mostRecentTime = 0;
	for (auto& edge : currentNode.getEdgeList())
	{
		if (edge->getPheromone() > 0 && *edge->getPheromoneNextNode() != currentNode && 
			edge->getPheromoneNextNodeTickTime() > mostRecentTime)
		{
			mostRecentNode = edge->getPheromoneNextNode();
			mostRecentTime = edge->getPheromoneNextNodeTickTime();
		}
	}
	return mostRecentNode;
}
Node * AntFindFood :: checkEdgesForPheromone ( Node & currentNode ) { Node * mostRecentNode = nullptr ; uint mostRecentTime = 0 ; for ( auto & edge : currentNode . getEdgeList ( ) ) { if ( edge -> getPheromone ( ) > 0 && * edge -> getPheromoneNextNode ( ) != currentNode && edge -> getPheromoneNextNodeTickTime ( ) > mostRecentTime ) { mostRecentNode = edge -> getPheromoneNextNode ( ) ; mostRecentTime = edge -> getPheromoneNextNodeTickTime ( ) ; } } return mostRecentNode ; }
Checks the current node's edges for pheromones.
Checks the current node ' s edges for pheromones .