Closed kxhit closed 6 years ago
Hello @kxhit ,
This is because multi_index in boost 1.54 does not support std::unique_ptr as element yet (no copy constructor). Please upgrade boost to at least 1.55.
This is addressed in 1.55 release notes:
Non-copyable elements (such as std::unique_ptr
Many thanks @silmerusse ! Now I can run the program successfully!
It seems like multi-agent path finding algorithm in astar_multi_agent_map
will not avoid conflicts when one agent's target point is just right in another agent's only way (which must be passed) .When one agent arrives at it's target point, it will not make ways for other agents (seems will never move again). They will avoid conflicts in other situations.
Is there any misunderstanding? Looking forward to your reply!
@kxhit ,
Well, actually to simplify the problem, if an agent reaches it's destination I just remove it from the searching node so that it no longer be an obstacle to other agents, especially to those having the same destination. Of course you can change this behavior to satisfy your needs. In fact, I think there are a lot more to enhance for multi-agent path finding in a more realistic scenario. This is just a sample to showcase A* algorithm.
Thanks! @silmerusse ,
Is there any simple solution to make multi-agent path finding (astar_multi_agent_map)
to get diagonal path? I make enable_diagonal_=true
, but still get straight path. Could you help me? It seems result.push_back(fudge::Edge<NodeType, double>(from, to, 1));
in multi_agent_map.h
make every edge's cost to be 1 (not like in grid_map.h, the cost will be 1 or 1.4143 depends on the coordinate ).
Right now multi_agent_map does not support grid_map's diagonal path feature yet. I haven't made it inherit from grid_map because an edge in multi_agent_map has a different meaning. (The edge cost here is "turn" instead of grid distance. Therefore it's always 1.) Also it's for simplifying problem because if cost of any move is integer it is easier to know agent state and position at any given turn and it's simple to resolve conflicts.
To support diagonal path, you may need to change possible_moves(const Agent &agent) to make it generate diagonal moves for an agent. Also you should consider how to handle agent moving in diagonal, which has a non-integer cost, while the turns are integers. It could be implemented but I think it would be a little complicated. Please feel free to enhance it if you are interested. : )
By the way, if you are developing a game, I would not recommend to use the algorithm in multi_agent_map sample. The sample demonstrated how to use one time search for multiple agents to find paths that have no conflicts. But this is in an ideal scene and its performance is quite low. It's common in a game, where obstacles are often dynamic, to calculate individual path for each agent. When a conflict happens or after a regular interval, a new path would be regenerated. Also there are other techniques to gain better performance besides A* searching.
Hi! I run cmake and make, but got an error below. It seems like executable
fudge_gui
did not compile successfully. Something witherror: use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = Item; _Dp = std::default_delete<Item>]’ and
/usr/include/c++/4.8/bits/unique_ptr.h:273:7: error: declared here unique_ptr(const unique_ptr&) = delete;` Could anyone help me? Thanks in advance! I am building in Ubuntu14.04 & gcc 4.8.5 & boost1.54.