I havent been using C++ in 4 years and therefore I have some difficulties implementing my BFS algorithm.
I keep getting errors like
Error 12 error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const Node' c:\program files\microsoft visual studio 8\vc\include\functional 143
Could anyone please help me what could be the prob?
Thanks a lot!
int _tmain(int argc, _TCHAR* argv[])
{
list<Action> actions;
list<Action>::iterator j;
int frontier_no=0;
queue<Node> frontier;
set<Node> explored;
char command_line[150];
int acts=0;
if(argc==8)
{
printf("Enter: file name, links file, algorithm name(bfs/dfs/astar), closed list(Y/N), depth to search, id of the starting node, id of the goal node, name of new file: ");
scanf("%s",command_line); //read the name of the file
sscanf(command_line,"%s %s %s %s %d %l %l %s",file_name,links_file,alg,with_list,depth,idstart,idgoal,new_name);
string start_node;
string end_node;
string distance;
string one_way;
string road;
string line;
int no_links;
int line_no;
ifstream fp(links_file);
if (fp.is_open())
{
while (!fp.eof())
{
getline (fp,line);
line_no++;
}
fp.close();
}
if (fp.is_open())
{
while (!fp.eof())
{
getline(fp,line);
istringstream iss(line);
iss >> start_node;
iss>>end_node;
iss>>distance;
iss>>one_way;
iss>>road;
iss>>line;
Action a;
a.distance=atoi(distance.c_str());
a.end_node=atol(end_node.c_str());
a.one_way=atoi(one_way.c_str());
a.road=road;
a.start_node=atol(start_node.c_str());
//=new Action(atol(start_node.c_str()),atol(end_node.c_str()),atoi(distance.c_str()),atoi(one_way.c_str()),road);
actions.push_back(a);
acts++;
}
fp.close();
}
else cout << "Unable to open file";