libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
HRICS_MultiAgentGrid.hpp
1 #ifndef HRICS_MULTI_AGENT_GRID_HPP
2 #define HRICS_MULTI_AGENT_GRID_HPP
3 //#define DRAW_FRONTIER_HAND_IN_HAND
4 //#define DRAW_FRONTIER_STEPS // for generating pictures for algo explanation
5 //#define CARACT_TIME_FIND_CELLS_IN_RANGE
6 #define DRAW_OPTIMIZE_FRONTIER
7 
8 #include "API/planningAPI.hpp"
9 #include "API/Grids/gridsAPI.hpp"
10 #include "Logging/Logger.h"
11 
12 namespace HRICS
13 {
14 
15 class MetaFrontierCells;
16 struct FrontierCells;
17 class MultiAgentCell;
18 
19 typedef std::tr1::shared_ptr<FrontierCells> FrontierPtr;
20 typedef std::tr1::shared_ptr<MetaFrontierCells> MetaFrontierPtr;
21 
22 
29 {
30  MOVE3D_STATIC_LOGGER;
31 public:
32  class AgentInGrid;
37  public:
38  typedef std::tr1::shared_ptr<MetaAgentInGrid> s_ptr;
39  MetaAgentInGrid(unsigned int agent_number);
40  MetaAgentInGrid::s_ptr shared_clone();
41  std::vector<AgentInGrid*> & getAgentsInGrid(void){return this->_realAgents;}
42  void addAgent(AgentInGrid* a,s_ptr s_ptr_this);
43  private:
44  void removeAgent(AgentInGrid* a);
45  public:
46  //getter/setters
47  Robot* getCylinder(void){return _cylinder;}
48  double getCylinderRadius(void){return _cyl_radius;}
49  void setCylinder(Robot * c);
51  std::vector<MultiAgentCell*> & reachable(){return _reachable;}
53  std::vector<MultiAgentCell*> & boundaries(){return _boundaries;}
55  std::vector<MultiAgentCell* > & frontiers(MetaAgentInGrid::s_ptr other){return _frontiers[other.get()];}
56  std::vector<MultiAgentCell* > & frontiers_ok(MetaAgentInGrid::s_ptr other){return _frontiers_ok[other.get()];}
57  bool frontierFullyChecked(MetaAgentInGrid::s_ptr other){return _frontierFullyChecked[other.get()];}
58  void setFrontierFullyChecked(MetaAgentInGrid::s_ptr other,bool b=true){_frontierFullyChecked[other.get()]=b;}
59  bool isFrontierComputed(MetaAgentInGrid::s_ptr other){return _frontiersComputed[other.get()];}
60  void setFrontierComputed(MetaAgentInGrid::s_ptr other,bool b=true){_frontiersComputed[other.get()]=b;}
61 
62  char letter_id;
63  private:
64  Robot* _cylinder;
65  double _cyl_radius;
66  std::vector<MultiAgentCell*> _reachable;
69  std::vector<MultiAgentCell*> _boundaries;
71  std::map<MetaAgentInGrid*, std::vector<MultiAgentCell* > > _frontiers;
72  std::map<MetaAgentInGrid*, std::vector<MultiAgentCell* > > _frontiers_ok;
73  std::map<MetaAgentInGrid*, bool> _frontierFullyChecked;
74  std::map<MetaAgentInGrid*, bool> _frontiersComputed;
75 
76  std::vector<AgentInGrid*> _realAgents;
77  static char _letter_id_cnt;
78  };
79 
83  class AgentInGrid{
84  public:
85  Robot* getRobot(){return _robot;}
86  void setRobot(Robot* r){_robot=r;}
88  Robot* getCylinder(){return _metaAgent->getCylinder();}
89  double getMaxDist(){return _maxDist;}
90  void setMaxDist(double d){_maxDist=d;}
91  //std::vector<MultiAgentCell*> accessible; ///<the list of cells where the agent can 'fit'. NOT where it actually can travel. @warning obsolete
92  MultiAgentCell* getOrigin(){return this->_origin;}
93  void setOrigin(MultiAgentCell* c){this->_origin=c;}
94  MultiAgentCell* getTarget(){return this->_target;}
95  void setTarget(MultiAgentCell* c){this->_target=c;}
97  std::vector<MultiAgentCell*> & reachable(){return _metaAgent->reachable();}
99  std::vector<MultiAgentCell*> & boundaries(){return _metaAgent->boundaries();}
101  std::vector<MultiAgentCell* > & frontiers(AgentInGrid *other){return getMetaAgent()->frontiers(other->getMetaAgent());}
102  bool frontierFullyChecked(AgentInGrid* other){return _metaAgent->frontierFullyChecked(other->getMetaAgent());}
103  void setFrontierFullyChecked(AgentInGrid* other,bool b=true){_metaAgent->setFrontierFullyChecked(other->getMetaAgent(),b);}
104  bool isHuman(){return getRobot()->getHriAgent()->is_human;}
105  double getSpeed(void){return _speed;}
106  void setSpeed(double s){_speed=s;}
107  bool isDistanceComputed(){return _distanceComputed;}
108  void setDistanceComputed(bool b=true){_distanceComputed=b;}
109  void setMetaAgent(MetaAgentInGrid::s_ptr meta){_metaAgent=meta;}
110  MetaAgentInGrid::s_ptr getMetaAgent(void){return _metaAgent;}
111  private:
112  Robot* _robot;
113  double _speed;
114  double _maxDist;
115  bool _distanceComputed;
116  MetaAgentInGrid::s_ptr _metaAgent;
117  MultiAgentCell *_origin,*_target;
118 
119  };
120 
122  timespec access_total_time;
123  std::vector<timespec> reachability_time;
124  timespec reachability_total_time;
125  std::vector<timespec> frontiers_time;
126  std::vector<unsigned int> frontiers_iterations;
127  timespec frontiers_total_time;
128  unsigned int frontiers_total_iterations;
129  ComputationStat(void){
130  access_total_time.tv_nsec = 0;
131  access_total_time.tv_sec = 0;
132  reachability_time.clear();
133  reachability_total_time.tv_nsec=0;
134  reachability_total_time.tv_sec=0;
135  reset_frontiers(0);
136  }
137  void reset_frontiers(unsigned int size){
138  frontiers_time.assign(size,null_ts());
139  frontiers_iterations.assign(size,0);
140  frontiers_total_iterations=0;
141  frontiers_total_time=null_ts();
142  }
143  static timespec null_ts(void){timespec nts;nts.tv_nsec=nts.tv_sec=0;return nts;}
144  };
145 
146  MultiAgentGrid();
153  MultiAgentGrid(double pace, std::vector<double> envSize);
160  MultiAgentGrid(double pace, std::vector<double> envSize, std::vector<Robot *> &agents);
161  ~MultiAgentGrid();
162 
163  void resetData(void);
164  //getters and setters
170  void setAgents(std::vector<Robot*> &agents);
171  std::vector<Robot*> & getAgents() { return mAgents; }
172  AgentInGrid* getAgentStructAt(unsigned int index){return mAgentsInGrid[index];}
173 
174  void setAgentTarget(unsigned int a);
175 
176  double getNbCellX() {return _nbCellsX;}
177  double getNbCellY() {return _nbCellsY;}
178 
179  void setAsNotSorted() {gridIsSorted = false;}
180 
181  void dumpVar();
182 
186  void init(void);
193  void initCylinders(void);
198  void computeAccessibility(void);
199  void computeAccessAndDistCombined(void);
200 
215  std::vector<MultiAgentCell*> computeOtherTrajectory(MultiAgentCell * cell_origin, MultiAgentCell *cell_dest, unsigned int agent_index,double epsilon=1,double dist_max=-1,int max_expansions=-1);
216 
218  bool areCellsInNeighbourhood(MultiAgentCell* c1,MultiAgentCell *c2,unsigned int a,double dist);
219 
223  API::TwoDCell* createNewCell(unsigned int index,unsigned int x,unsigned int y );
224 
228  void computeDistances();
229  void computeDistancesForAgent(MultiAgentCell* cell, unsigned int agent_index);
230  void computeAltDistancesForAgent(MultiAgentCell* origin, unsigned int agent_index);
231  void enableAltDistancesSums(bool b=true){_enable_alt_distances_sums=b;if(b){this->clearAltDistancesInCells();}}
232  void clearAltDistancesInCells(void);
233 
234  unsigned int getMaxAlternativeDistancesForCells(void){return _max_alternative_distances_for_cells;}
235  void getMaxAlternativeDistancesForCells(unsigned int v){_max_alternative_distances_for_cells=v;}
236 
237 
246  std::pair<MultiAgentCell*,MultiAgentCell*> neighborSolution(unsigned int agent_1,unsigned int agent_2,std::pair<MultiAgentCell*,MultiAgentCell*> solution);
247  void searchAllFrontiers();
256  std::vector<FrontierPtr > searchFrontiers(unsigned int agent_1,unsigned int agent_2,double keep_distance);
257  std::vector<FrontierPtr > simulatedAnnealingFrontierSearch(unsigned int agent_1,unsigned int agent_2,double keep_distance);
258  std::vector<MetaFrontierPtr > hillClimberFrontierSearch(unsigned int agent1,unsigned int agent2, double keep_distance);
259  std::vector<FrontierPtr > frontierSearch(unsigned int agent1,unsigned int agent2, double keep_distance);
260  std::vector<FrontierPtr > exhaustiveFrontierSearch(unsigned int agent1,unsigned int agent2, double keep_distance);
261  std::vector<FrontierPtr > handInHandFrontierSearch(unsigned int agent1,unsigned int agent2, double keep_distance);
262 
263  void saveFrontiers(std::ofstream & output);
264  bool loadFrontiers(std::ifstream & input);
265 
268  void initVectorFrontiers(void);
270  unsigned int getFrontierIndex(unsigned int i,unsigned int j);
271  unsigned int getFrontierIndex(std::pair<unsigned int,unsigned int> ind){return getFrontierIndex(ind.first,ind.second);}
273  std::pair<unsigned int,unsigned int> getFrontierAgentIndices(unsigned int i);
274  //std::vector<std::tr1::shared_ptr<FrontierCells> > & getFrontier(unsigned int i,unsigned int j);
275  std::vector<MultiAgentCell*> const & getFrontierCells(unsigned int i, unsigned int j);
276  //void setFrontier(unsigned int i,unsigned int j,vector<std::tr1::shared_ptr<FrontierCells> > & frontier);
277  double getArmReach(unsigned int i);
278  double getArmReach(AgentInGrid *a);
281  double getHandOverReach(unsigned int i,unsigned int j);
282 
289  void addFrontier(unsigned int agent,unsigned int other, MultiAgentCell * cell);
290  FrontierPtr getRandomFrontier(unsigned int a1,unsigned int a2, double timeout_ms=-1);
291  std::vector<MultiAgentCell*> & getFrontierCheckedOk(unsigned int a1,unsigned int a2);
292 
293  double getFrontierSearchTempDecrease(void){return _frontier_search_temp_decrease;}
294  void setFrontierSearchTempDecrease(double v){_frontier_search_temp_decrease=v;}
295  double getFrontierSearchStartTemp(void){return _frontier_search_start_temp;}
296  void setFrontierSearchStartTemp(double v){_frontier_search_start_temp=v;}
297  unsigned int getFrontierSearchMaxIt(void){return _frontier_search_max_it;}
308  void setFrontierSearchMaxIt(unsigned int v){_frontier_search_max_it=v;}
309  double getFrontierSearchStopDist(void){return _frontier_search_stop_dist;}
316  void setFrontierSearchStopDist(double v){_frontier_search_stop_dist=(v==0 ? std::min(this->_cellSize[0],this->_cellSize[1]): v);}
317  ComputationStat & getComputationStats(void){return this->_computation_stat;}
318 
323 
327  void draw();
328 private:
329  void _drawCell(MultiAgentCell *cell, double *color);
330 
331 public:
332  void setAgentIndexToDrawGrid(int index){
333  this->_agent_index_to_draw_grid=index;
334  }
335  void setDrawAgentAccessibilityGrid(bool b,bool boundariesOnly=false){this->_drawAgentReachGrid=b; this->_drawBoundariesOnly=boundariesOnly;}
336  void setDrawAStar(bool b){_draw_a_star=b;}
337  void setDrawFrontiers(bool b,unsigned int i=0,unsigned int j=0){_drawFrontiers=b;_drawFrontierIndices.first=i;_drawFrontierIndices.second=j;}
338  void setDrawFrontiersSearchLog(bool b){_drawLog=b;}
339  unsigned int getFrontierSearchLogSize(void);
340  void setFrontierSearchLogIndex(unsigned int i){_log_draw_window=i;}
341  void setFrontierSearchLogWindow(unsigned int i){_log_draw_window_size=i;}
342 
343 #ifdef DRAW_OPTIMIZE_FRONTIER
344  void setDrawGridForOptim(bool b,std::vector<std::pair<MultiAgentCell*,unsigned int> > &cells_agents){_draw_grid_for_optim=b;_draw_grid_for_optim_cells_agents=cells_agents;}
345  void unsetDrawGridForOptim(void){_draw_grid_for_optim=false;_draw_grid_for_optim_cells_agents.clear();}
346 #endif
347 #if defined(DRAW_FRONTIER_HAND_IN_HAND) || defined(DRAW_OPTIMIZE_FRONTIER)
348  void setDrawOptimizeFrontier(MultiAgentCell *c1,MultiAgentCell* c2,bool ok){_draw_frontier_search_cells.first=c1;_draw_frontier_search_cells.second=c2;_draw_frontier_search_is_pair_ok=ok;_draw_frontier_search=true;}
349  void unsetDrawOptimizeFrontier(void){_draw_frontier_search=false;}
350 #endif
351 
352  void setDrawExtraCells(std::vector<MultiAgentCell*>::iterator first,std::vector<MultiAgentCell*>::iterator last,double ratio_max){
353  _draw_extra=true;
354  _draw_extra_cells=std::make_pair(first,last);
355  _temp_color_max_ratio=ratio_max;
356  }
357  void unsetDrawExtraCells(){_draw_extra=false;_draw_extra_cells.first=_draw_extra_cells.second;_temp_color_max_ratio=1;}
358 
360 
364  void setCellsToblankCost();
365 
369  void initAllCellState();
370 
374  void initAllTrajs();
375 
379  void resetAllAccessibility();
380  void resetDistances(void);
381 
385 // std::vector<std::pair<double,MultiAgentCell*> > getSortedGrid();
386 
387 private:
391  std::vector<Robot*> mAgents;
392  std::vector<AgentInGrid*> mAgentsInGrid;
393 
394  Robot* robotCyl;
395  Robot* humCyl;
396 
400  std::vector<std::pair<double,MultiAgentCell*> > sortedGrid;
401 
405  bool gridIsSorted;
406 
409  unsigned int _max_alternative_distances_for_cells;
410  bool _enable_alt_distances_sums;
411  std::pair<MultiAgentCell*,double> _best_cell_in_alt_dist_sum;
412 
413  //frontier searching
414  bool _use_reachable_for_frontier_search;
415  //std::vector<std::vector<std::tr1::shared_ptr<FrontierCells> > > _frontiers;
416  double _frontier_search_temp_decrease;
417  double _frontier_search_start_temp;
418  unsigned int _frontier_search_max_it;
419  double _frontier_search_stop_dist;
420  std::vector<std::vector<std::pair<double,std::pair<MultiAgentCell*,MultiAgentCell*> > > > _log_frontier_seeking;
421  unsigned int _log_draw_window;
422  unsigned int _log_draw_window_size;
423  bool _save_log_frontier;
424 
425 
426  //grid drawing parameters
427  bool _drawAgentReachGrid;
428  bool _drawBoundariesOnly;
429  bool _draw_a_star;
430 #if defined(DRAW_FRONTIER_HAND_IN_HAND) || defined(DRAW_OPTIMIZE_FRONTIER)
431  bool _draw_frontier_search;
432  std::pair<MultiAgentCell*,MultiAgentCell*> _draw_frontier_search_cells;
433  bool _draw_frontier_search_is_pair_ok;
434 #endif
435 #ifdef DRAW_OPTIMIZE_FRONTIER
436  bool _draw_grid_for_optim;
437  std::vector<std::pair<MultiAgentCell*,unsigned int> > _draw_grid_for_optim_cells_agents;
438 #endif
439 #ifdef DRAW_FRONTIER_STEPS
440  bool _draw_frontier_steps;
441  std::vector<MultiAgentCell*> _draw_frontier_steps_cells;
442 #endif
443  int _agent_index_to_draw_grid;
444  bool _drawFrontiers;
445  bool _drawLog;
446  std::pair<unsigned int, unsigned int> _drawFrontierIndices;
447  ComputationStat _computation_stat;
448  bool _draw_extra;
449  std::pair<std::vector<MultiAgentCell*>::iterator,std::vector<MultiAgentCell*>::iterator > _draw_extra_cells;
450  double _temp_color_max_ratio;
451 
452 
453  //debug parameters
454  bool _showText;
455 
456 };
457 
463 {
464 
466 public:
467  class AgentInCell;
469  {
470  public:
471  typedef std::tr1::shared_ptr<CylinderInCell> s_ptr;
472  CylinderInCell (Robot * cyl,bool access_computed=false,bool accessible=false):
473  _cylinder(cyl),_accessible(accessible),_access_computed(access_computed){}
474  bool isAccessible(){return _accessible;}
475  bool isAccessibilityComputed(){return _access_computed;}
476  void setAccessible(bool accessible){_accessible=accessible; _access_computed=true;}
477  void unsetAccessibilityComputed(){_accessible=_access_computed=false;}
478  Robot* getCylinder(){return _cylinder;}
479 
480  private:
481  Robot* _cylinder;
482  bool _accessible;
483  bool _access_computed;
484  };
485 
487  {
488  public:
489  typedef std::tr1::shared_ptr<MetaAgentInCell> s_ptr;
490  MetaAgentInCell(MultiAgentGrid::MetaAgentInGrid::s_ptr meta_in_grid,CylinderInCell::s_ptr cyl,bool reach_computed=false,bool reach=false,bool boundary=false):
491  _cylInCell(cyl),_reachable(reach),_reachComputed(reach_computed),_boundary(boundary), _metaAgentInGrid(meta_in_grid),letter_id(_letter_cnt++){}
492  MetaAgentInCell::s_ptr shared_clone(MultiAgentGrid::MetaAgentInGrid::s_ptr meta_in_grid);
493  void addRealAgent(AgentInCell* a, s_ptr s_this);
494  void removeAgent(AgentInCell* a);
495  bool isAccessible(){return _cylInCell->isAccessible();}
496  bool isAccessibilityComputed(){return _cylInCell->isAccessibilityComputed();}
497  void setAccessible(bool accessible){this->getCylinderInCell()->setAccessible(accessible);}
498  void unsetAccessibilityComputed(){getCylinderInCell()->unsetAccessibilityComputed();}
499  bool isReachable(){return _reachable;}
500  bool isReachabilityComputed(){return _reachComputed;}
501  void setReachability(bool b){_reachable=b;_reachComputed=true;}
502  void unsetReachabilityComputed(){_reachable=_reachComputed=false;}
503  bool isBoundary(){return _boundary;}
504  void setBoundary(bool b){_boundary=b;}
505 
506  CylinderInCell::s_ptr getCylinderInCell(void){return _cylInCell;}
507  MultiAgentGrid::MetaAgentInGrid::s_ptr getMetaAgentInGrid(){return _metaAgentInGrid;}
508 
509  std::vector<MetaFrontierPtr> & getFrontiers(MetaAgentInCell::s_ptr other){return _meta_frontiers[other->getMetaAgentInGrid().get()];}
510  std::vector<MetaFrontierPtr> & getFrontiers(MultiAgentGrid::MetaAgentInGrid::s_ptr other){return _meta_frontiers[other.get()];}
511 
512 
513  private:
514  CylinderInCell::s_ptr _cylInCell;
515  bool _reachable;
516  bool _reachComputed;
517  bool _boundary;
518  MultiAgentGrid::MetaAgentInGrid::s_ptr _metaAgentInGrid;
519  std::vector<AgentInCell*> _realAgents;
520  static char _letter_cnt;
521  std::map< MultiAgentGrid::MetaAgentInGrid*,std::vector<MetaFrontierPtr > > _meta_frontiers;
522  public:
523  char letter_id;
524  };
525 
529  struct AgentInCell{
530  void initFrontiersVector(unsigned int size){_frontiers.assign(size,std::vector<FrontierPtr>(0));}
532  // traj //
533  std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > vect_traj;
534  std::vector<MultiAgentCell*> traj;
535  // accessibility //
536  bool isAccessible(){return getMetaAgent()->isAccessible();}
537  bool isAccessibilityComputed(){return getMetaAgent()->isAccessibilityComputed();}
538  void setAccessible(bool b){getMetaAgent()->setAccessible(b);}
539  void unsetAccessibilityComputed(){getMetaAgent()->unsetAccessibilityComputed();}
540  // reachability //
543  bool isReachable(){return checkMetaAgent() && getMetaAgent()->isReachable();}
545  bool isReachabilityComputed(){assert(checkMetaAgent()); return getMetaAgent()->isReachabilityComputed();}
547  void setReachability(bool b){assert(this->checkMetaAgent()); getMetaAgent()->setReachability(b);}
548  void unsetReachabilityComputed(){assert(checkMetaAgent());getMetaAgent()->unsetReachabilityComputed();}
549  // distance //
551  double distance;
554  std::deque<double> distance_alternatives;
555  std::deque<MultiAgentCell*> origin_alternatives;
556  std::deque<MultiAgentCell*> come_from_alternatives;
557  // boundaries //
562  bool isBoundary(void){return getMetaAgent()->isBoundary();}
563  void setBoundary(bool b){getMetaAgent()->setBoundary(b);}
564  std::vector<std::tr1::shared_ptr<FrontierCells> > & frontiers(AgentInCell* other){return _frontiers[other->index];}
565  std::vector<MetaFrontierPtr> & getMetaFrontier(AgentInCell* other){return getMetaAgent()->getFrontiers(other->getMetaAgent());}
566  std::vector<MetaFrontierPtr> & getMetaFrontier(MultiAgentGrid::MetaAgentInGrid::s_ptr other){return getMetaAgent()->getFrontiers(other);}
567  // other //
568  Robot * robot(void){return agentInGrid->getRobot();}
569  CylinderInCell::s_ptr getCylinderInCell(void){return this->getMetaAgent()->getCylinderInCell();}
570  MetaAgentInCell::s_ptr getMetaAgent(){return _metaAgentInCell;}
571  void setMetaAgent(MetaAgentInCell::s_ptr meta){_metaAgentInCell=meta;metaLetter=_metaAgentInCell->letter_id;}
572  bool checkMetaAgent(){return (this->agentInGrid->getMetaAgent()==this->getMetaAgent()->getMetaAgentInGrid());}
573  char metaLetter;
574  unsigned int index;
575  private:
576  MetaAgentInCell::s_ptr _metaAgentInCell;
577  std::vector<std::vector<FrontierPtr > > _frontiers;
578  };
579 
580 
581 public:
582  MultiAgentCell();
583  MultiAgentCell(int i, Eigen::Vector2i coord, Eigen::Vector2d corner, MultiAgentGrid* grid);
584 
585  ~MultiAgentCell() { }
586 
587  //#######################
588  //getters et setters ####
589  //#######################
590 
597  AgentInCell * getAgentAt(unsigned int i){return _agentsInCell[i];}
598  unsigned int getAgentNumber(){return _agentsInCell.size();}
599  MultiAgentGrid::MetaAgentInGrid::s_ptr getMetaFromGrid(unsigned int a){return this->getAgentAt(a)->agentInGrid->getMetaAgent();}
600 
602  void resetData(void);
603 
604  //distance computing
605  void setDistance(unsigned int index,double value) {getAgentAt(index)->distance = value; }
606  void setAltDistance(unsigned int index, double value, MultiAgentCell* alt_origin, MultiAgentCell *previous_cell=0);
607  double getDistance(unsigned int index) {return getAgentAt(index)->distance; }
608  double getAltDistance(unsigned int index,MultiAgentCell* alt_origin);
609  void setDistanceIsComputed(unsigned int index) {getAgentAt(index)->distanceIsComputed = true;}
610  void unsetDistanceIsComputed(unsigned int index) {getAgentAt(index)->distanceIsComputed = false;}
611  bool isDistanceComputed(unsigned int index) {return getAgentAt(index)->distanceIsComputed;}
612 
617  double getDistanceAny(unsigned int agent,MultiAgentCell* other);
618  std::vector<MultiAgentCell*> getTrajAny(unsigned int agent, MultiAgentCell *origin);
621  std::vector<MultiAgentCell*> getAltTraj(unsigned int agent, MultiAgentCell *alt_origin, bool reverse=false);
622 
623  // distance propagation algorithm
624  bool getOpen() { return _Open; }
625  void setOpen() { _Open = true; }
626 
627  bool getClosed() { return _Closed; }
628  void setClosed() { _Closed = true; }
629 
630  double getTempColor(){return _tmp_color;}
631  void setTempColor(double c){_tmp_color=c;}
632 
633  void resetExplorationStatus() { _Open = false; _Closed = false; }
634 
635  // Trajectories
636 
637  std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > & getVectorTraj(unsigned int index) {return getAgentAt(index)->vect_traj;}
638  void setVectorTraj(unsigned int index,std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > & vec_traj) {getAgentAt(index)->vect_traj = vec_traj; }
639 
640  std::vector<MultiAgentCell*> & getTraj(unsigned int index) {return getAgentAt(index)->traj;}
641  //std::vector<Eigen::Vector2d> getTempVectorTraj(void);
642  void setTraj(unsigned int index, std::vector<MultiAgentCell*> & traj) {this->getAgentAt(index)->traj = traj; }
643  double getTempDist(void){return _temp_dist;}
644  void setTempDist(double v){_temp_dist=v;}
645  double getTempEstim(void){return _temp_estim;}
646  void setTempEstim(double v){_temp_estim=v;}
647  MultiAgentCell* getTempCameFrom(void) {return _temp_came_from;}
648  void setTempCameFrom(MultiAgentCell * f) {_temp_came_from=f;}
649 
650  //void setAltCameFrom(unsigned int index,MultiAgentCell* origin,MultiAgentCell* previous);
651  MultiAgentCell* getAltCameFrom(unsigned int index, MultiAgentCell* alt_origin);
652 
653  //accessibility
654  bool isAccessible(unsigned int index){return getAgentAt(index)->getCylinderInCell()->isAccessible();}
655  void setAccessible(unsigned int index,bool v){getAgentAt(index)->getCylinderInCell()->setAccessible(v);}
656  bool isAccessibilityComputed(unsigned int index){return getAgentAt(index)->getCylinderInCell()->isAccessibilityComputed();}
657  //void setAccessibilityComputed(unsigned int index,bool v){}//getAgentAt(index)->getCylinderInCell()->setAccessibilityComputed(v);}
658  void setReachable(unsigned int index,bool b){getAgentAt(index)->setReachability(b);}
659  bool isReachable(unsigned int index){return getAgentAt(index)->isReachable();}
660 
661  bool isBoundary(unsigned int index){return getAgentAt(index)->isBoundary();}
662  bool isFrontier(unsigned int a1,unsigned int a2){return (getAgentAt(a1)->frontiers(getAgentAt(a2)).size() > 0);}
663 
664  bool checkIsInCollision(unsigned int agent_this,MultiAgentCell* other,unsigned int agent_other);
665 
667  std::vector<std::tr1::shared_ptr<FrontierCells> > createAllRealFrontiersFor(unsigned int a1,unsigned int a2);
670  FrontierPtr createRealFrontierFor(unsigned int a1,unsigned int a2, MetaFrontierPtr mfrontier);
671  std::vector<MetaFrontierPtr> & getMetaFrontier(unsigned int a1,unsigned int a2){
672  assert (isReachable(a1));
673  //checkMetaAgent(a2);
674  return getAgentAt(a1)->getMetaFrontier(getMetaFromGrid(a2));
675  }
676  std::vector<MetaFrontierPtr> & getMetaFrontier(unsigned int a1,MultiAgentGrid::MetaAgentInGrid::s_ptr m2){
677  assert (isReachable(a1));
678  return getAgentAt(a1)->getMetaFrontier(m2);
679  }
683  FrontierPtr getRealFrontier(unsigned int a1,unsigned int a2,MetaFrontierPtr mfrontier);
684 
685  //other
686  void setBlankCost() { _costIsComputed = false;}
687  //void setCost(double value) {getAgentAt(index)->cost = value; }
688  //double getCost() {return mCost; }
689  //double getMoveCost(unsigned int index){return getAgentAt(index)->moveCost;}
690 
691  Eigen::Vector2i getCoord() { return _Coord; }
692 
693 
694 
695  //#######################
696  // others ###############
697  //#######################
698 
702  void computeAccessibility(unsigned int index_agent);
703 
704  // /**
705  // * @brief compute move cost for an agent, according to it's speed.
706  // * @param index_agent
707  // * @return
708  // * @todo use different weights for travel distance and duration
709  // */
710  //double computeMoveCost(unsigned int index_agent);
714  double computeCost();
715 
719  bool computeBestRobotPos();
720 
723  bool checkMetaAgent(unsigned int index);
724 
728  void resetAccessibility();
730  void resetAccessibility(unsigned int index);
731  void resetDistances(unsigned int index);
732  void resetAllDistances(void);
733 
737  void resetTraj();
739  void resetTraj(unsigned int index);
740 
744  std::vector<MultiAgentCell*> getNeighbors(unsigned int index);
745 
746  std::vector<MultiAgentCell*> findNeighborsInRange(unsigned int agent,double range);
747 
751  double computeDist(MultiAgentCell* neighCell);
752 
756  void addPoint(double Rz);
757 
761  std::vector<MultiAgentCell*> getCrown(double min, double max);
762 
763 
764  std::tr1::shared_ptr<MetaFrontierCells> addMetaFrontier(MultiAgentCell *other, bool over_obstacle, unsigned int agent_this,unsigned int agent_other,double dist,bool check_exists=false);
765  std::tr1::shared_ptr<MetaFrontierCells> addMetaFrontier(MultiAgentCell *other, bool over_obstacle, MetaAgentInCell::s_ptr agent_this, MetaAgentInCell::s_ptr agent_other, double dist, bool check_exists=false);
766  std::tr1::shared_ptr<FrontierCells> addFrontierComplete(MultiAgentCell *other, bool over_obstacle, unsigned int agent_this,unsigned int agent_other,double dist,bool check_exists=false);
767 
768 private:
769 
770  std::vector<AgentInCell*> _agentsInCell;
771  std::vector<CylinderInCell::s_ptr> _cylinders;
772  std::vector<MetaAgentInCell::s_ptr> _metaAgents;
773 
777  Eigen::Vector2i _Coord;
778 
782  bool _Open;
783 
787  bool _Closed;
788 
789  bool _costIsComputed;
790 
791  double _tmp_color;
792 
796  MultiAgentCell * _temp_came_from;
798  double _temp_dist;
799  double _temp_estim;
800 
801  double _alt_distance_sum;
802 
803 };
804 
806 public:
807  MetaFrontierCells(MultiAgentGrid::MetaAgentInGrid::s_ptr agentA,MultiAgentCell* cellA,MultiAgentGrid::MetaAgentInGrid::s_ptr agentB, MultiAgentCell* cellB,double distance,bool over_obstacle) :
808  _metaA(agentA),_metaB(agentB),_cellA(cellA),_cellB(cellB), _dist(distance), _checked_ok(0), _over_obstacle(over_obstacle) {}
809  MultiAgentCell * cellOf(MultiAgentGrid::MetaAgentInGrid::s_ptr meta){
810  if(meta==_metaA){return _cellA;}
811  if(meta==_metaB){return _cellB;}
812  return 0x0;
813  }
814  FrontierPtr getRealFrontier (MultiAgentGrid::AgentInGrid* a1, MultiAgentGrid::AgentInGrid* a2) {
815  //if (a1>a2){std::swap(a1,a2);}
816  return _implementations_of_this[std::make_pair(a1,a2)];
817  }
818  void setRealFrontier (MultiAgentGrid::AgentInGrid* a1, MultiAgentGrid::AgentInGrid* a2,FrontierPtr frontier) {
819  //if (a1>a2){std::swap(a1,a2);}
820  _implementations_of_this[std::make_pair(a1,a2)] = frontier;
821  }
822  MultiAgentCell* getCellA(){return _cellA;}
823  MultiAgentCell* getCellB(){return _cellB;}
824  double getDistance(){return _dist;}
826  CheckCellsAre(MultiAgentCell* cell1,MultiAgentGrid::MetaAgentInGrid::s_ptr a1,MultiAgentCell* cell2,MultiAgentGrid::MetaAgentInGrid::s_ptr a2) :
827  cell1(cell1),cell2(cell2),a1(a1),a2(a2){}
828  CheckCellsAre(MetaFrontierPtr & val){cell1=val->_cellA;cell2=val->_cellB;a1=val->_metaA;a2=val->_metaB;}
829  bool operator()(MetaFrontierPtr other){
830  if(other->cellOf(a1) == cell1 && other->cellOf(a2) == cell2){
831  return true;
832  }
833  return false;
834  }
835  MultiAgentCell* cell1,*cell2;
836  MultiAgentGrid::MetaAgentInGrid::s_ptr a1,a2;
837  };
838 
839  bool getCheckedOk(){return _checked_ok;}
840  void setCheckedOk(bool b=true){_checked_ok=b;}
841  confPtr_t getObjectPosition(){return object_position;}
842  void setObjectPosition(confPtr_t q_obj){this->object_position = q_obj;}
843  bool isOverObstacle(){return _over_obstacle;}
844 
845 private:
846  std::map<std::pair<MultiAgentGrid::AgentInGrid*,MultiAgentGrid::AgentInGrid*>, FrontierPtr> _implementations_of_this;
847  MultiAgentGrid::MetaAgentInGrid::s_ptr _metaA;
848  MultiAgentGrid::MetaAgentInGrid::s_ptr _metaB;
849  MultiAgentCell * _cellA;
850  MultiAgentCell * _cellB;
851  double _dist;
852  bool _checked_ok;
853  confPtr_t object_position;
854  bool _over_obstacle;
855 };
856 
858  enum FrontierCheckStatus {FCS_NONE=0, FCS_OBJECT, FCS_GRAB_CONFS, FCS_HANDOVER,FCS_TRAJECTORIES,FCS_ENUM_SIZE};
859  FrontierCells() : agentA(0),agentB(0),agentA_ind(0),agentB_ind(0),
860  confA(),confB(),check_status(FCS_NONE),status_ok(FCS_ENUM_SIZE,false),//object_ok(0),grab_confs_ok(0),handover_ok(0),
861  object_position(),grabA(),grabB(),trajA(0),trajB(0),confChecked(0),_symetric(true),
862  cell(0), meta_frontier() {status_ok[FCS_NONE]=true;}
863  virtual ~FrontierCells();
864  MultiAgentCell * cellA(){return meta_frontier->getCellA();}
865  MultiAgentCell * cellB(){return meta_frontier->getCellB();}
868  unsigned int agentA_ind;
869  unsigned int agentB_ind;
870  confPtr_t confA;
871  confPtr_t confB;
872  confPtr_t r_confA,r_confB;
873  double dist(){return meta_frontier->getDistance();}
874  FrontierCells::FrontierCheckStatus check_status,r_check_status;
875  //bool object_ok;
876  //bool grab_confs_ok;
877  //bool handover_ok;
878  std::vector<bool> status_ok;
879  std::vector<bool> r_status_ok;
880  std::tr1::shared_ptr<Configuration> object_position;
881  std::tr1::shared_ptr<Configuration> r_object_position;
882  Eigen::Vector3d grabA;
883  Eigen::Vector3d grabB;
884  Eigen::Vector3d r_grabA,r_grabB;
887  bool confChecked;
888 private:
889  bool _symetric;
890 public:
892  bool isSymetric(){return _symetric;}
893 
896  void deSymetrize();
897 
898  MultiAgentCell* cellOf(unsigned int agent){
899  if(agent==agentA_ind){return cellA();}
900  if(agent==agentB_ind){return cellB();}
901  return 0x0;
902  }
903  confPtr_t confOf(Robot *r){
904  if(agentA->robot()==r){return confA;}
905  else if(agentB->robot()==r){return confB;}
906  else {confPtr_t p; return p;}
907  }
912  FrontierPtr neighbourFrontier(double keep_distance, double min_distance=0);
913  std::vector<FrontierPtr> findNeighbourFrontiers(double keep_distance, double min_distance=0);
914  std::vector<FrontierPtr> findNeighbourFrontiersJumping(double keep_distance,double min_distance,unsigned int number);
915  MultiAgentCell *cell;
916  MetaFrontierPtr meta_frontier;
917  bool isOverObstacle(){return meta_frontier->isOverObstacle();}
918 };
919 }
920 
921 
922 
923 #endif // HRICS_TWODGRID_HPP
void init(void)
initialisation of the grid (find cylinders corresponding to each agent)
Definition: HRICS_MultiAgentGrid.cpp:171
void computeAccessibility(unsigned int index_agent)
test if there is a collision with a BB (the cylinders) for the agent referenced in the the MultiAgent...
Definition: HRICS_MultiAgentGrid.cpp:2270
bool computeBestRobotPos()
compute best robot pos
void setFrontierSearchMaxIt(unsigned int v)
set the computational cost limit in # of iterations for the frontier search algorithm.
Definition: HRICS_MultiAgentGrid.hpp:308
double distance
distance of this cell from initial position of agent (shortest)
Definition: HRICS_MultiAgentGrid.hpp:553
std::vector< MultiAgentCell * > & reachable()
the list of cells where the agent can go, reachable space, it's included in accessible.
Definition: HRICS_MultiAgentGrid.hpp:51
void addFrontier(unsigned int agent, unsigned int other, MultiAgentCell *cell)
add a frontier cell to the agent 'agent'
Definition: HRICS_MultiAgentGrid.cpp:1901
bool distanceIsComputed
whether the distance have been computed or is unknown false either means that it is unreachable (inf ...
Definition: HRICS_MultiAgentGrid.hpp:550
Definition: HRICS_MultiAgentGrid.hpp:121
void setCellsToblankCost()
call setBlankCost() in each cell
Definition: HRICS_MultiAgentGrid.cpp:697
Definition: HRICS_MultiAgentGrid.hpp:486
std::vector< MultiAgentCell * > getAltTraj(unsigned int agent, MultiAgentCell *alt_origin, bool reverse=false)
returns the shortest path FROM alt_origin TO this except if reverse is set to true, its the other way around
Definition: HRICS_MultiAgentGrid.cpp:2102
std::vector< MultiAgentCell * > traj
the shortest path to come to this cell from starting position
Definition: HRICS_MultiAgentGrid.hpp:534
API::TwoDCell * createNewCell(unsigned int index, unsigned int x, unsigned int y)
function that creates a new Cell.
Definition: HRICS_MultiAgentGrid.cpp:392
FrontierPtr createRealFrontierFor(unsigned int a1, unsigned int a2, MetaFrontierPtr mfrontier)
creates and set a real frontier as a specialization of the given MetaFrontier, for agents a1 and a2 r...
Definition: HRICS_MultiAgentGrid.cpp:2210
Definition: HRICS_MultiAgentGrid.hpp:805
bool select_reverse
used as flag/argument for functions, to use symetric/direct direction or reverse direction ...
Definition: HRICS_MultiAgentGrid.hpp:891
Robot * getCylinder()
the cylinder for collision computation.
Definition: HRICS_MultiAgentGrid.hpp:87
std::vector< MultiAgentCell * > & reachable()
the list of cells where the agent can go, reachable space, it's included in accessible.
Definition: HRICS_MultiAgentGrid.hpp:96
unsigned int getFrontierIndex(unsigned int i, unsigned int j)
computes the index int the frontier vector corresponding to the frontiers between agents at i and j...
Definition: HRICS_MultiAgentGrid.cpp:1834
double computeCost()
compute move cost for an agent, according to it's speed.
void resetAllAccessibility()
call resetReacheability() in each cell
Definition: HRICS_MultiAgentGrid.cpp:724
void setFrontierSearchStopDist(double v)
set at which distance the frontier search should stop.
Definition: HRICS_MultiAgentGrid.hpp:316
double getHandOverReach(unsigned int i, unsigned int j)
an approximation of the maximal distance for a handover (touching hands) The sum of the arm reachs of...
Definition: HRICS_MultiAgentGrid.cpp:1897
std::vector< MultiAgentCell * > & frontiers(AgentInGrid *other)
the cells that are frontiers for the agent with other agents
Definition: HRICS_MultiAgentGrid.hpp:100
void computeAccessibility(void)
compute the Accessibility for each agent.
void resetTraj()
reset the Trajectories computing
Definition: HRICS_MultiAgentGrid.cpp:2419
API::Trajectory * r_trajB
idem, in the handover from B to A
Definition: HRICS_MultiAgentGrid.hpp:886
Plannar HRI Grid considering multiple agents systems for HRi operations.
Definition: HRICS_MultiAgentGrid.hpp:28
class representing data that can be common to several agents (reachable space, cylinder, frontiers, etc...)
Definition: HRICS_MultiAgentGrid.hpp:36
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
std::vector< MultiAgentCell * > computeOtherTrajectory(MultiAgentCell *cell_origin, MultiAgentCell *cell_dest, unsigned int agent_index, double epsilon=1, double dist_max=-1, int max_expansions=-1)
computeOtherTrajectory uses A* algo to find shortest path between 2 cells.
Definition: HRICS_MultiAgentGrid.cpp:843
Definition: TwoDCell.hpp:19
AgentInCell * getAgentAt(unsigned int i)
getAgentAt
Definition: HRICS_MultiAgentGrid.hpp:597
bool isHuman()
whether it's a human or not.
Definition: HRICS_MultiAgentGrid.hpp:103
void initVectorFrontiers(void)
inits the frontier container to the good size.
Definition: HRICS_MultiAgentGrid.cpp:1823
void resetAccessibility()
reset the reacheability computing for all agents
Definition: HRICS_MultiAgentGrid.cpp:2393
std::tr1::shared_ptr< Configuration > object_position
a position of the object where it may be reachable by the two agents (when from A to B or symetric) ...
Definition: HRICS_MultiAgentGrid.hpp:880
bool isAccessible()
true if the Agent (its cylinder) can fit in this cell, not if it actually can go there ...
Definition: HRICS_MultiAgentGrid.hpp:536
structure defining the data for an agent in a cell
Definition: HRICS_MultiAgentGrid.hpp:529
bool isReachabilityComputed()
check if the meta agent is correctly set, if it is, return reachability computation status...
Definition: HRICS_MultiAgentGrid.hpp:545
void initAllCellState()
call resetexplorationstatus() in each cell
Definition: HRICS_MultiAgentGrid.cpp:708
std::vector< MultiAgentCell * > getNeighbors(unsigned int index)
find the direct neighbors of this cell (used when computing distance propagation) ...
Definition: HRICS_MultiAgentGrid.cpp:2313
std::pair< MultiAgentCell *, MultiAgentCell * > neighborSolution(unsigned int agent_1, unsigned int agent_2, std::pair< MultiAgentCell *, MultiAgentCell * > solution)
find a neighhbour solution for the simulated annealing algorithm.
Definition: HRICS_MultiAgentGrid.cpp:1196
bool areCellsInNeighbourhood(MultiAgentCell *c1, MultiAgentCell *c2, unsigned int a, double dist)
check if the agent 'a' can go straight from one cell to another
Definition: HRICS_MultiAgentGrid.cpp:954
std::vector< FrontierPtr > searchFrontiers(unsigned int agent_1, unsigned int agent_2, double keep_distance)
searchFrontiers
Definition: HRICS_MultiAgentGrid.cpp:1235
This file implements macros to help with the logging, in a way similar to ROS, using log4cxx...
Definition: HRICS_MultiAgentGrid.hpp:825
void resetData(void)
reset data as for a new cell, set agents list according to the grid ones.
Definition: HRICS_MultiAgentGrid.cpp:2025
bool isDistanceComputed()
whether the distances (reachability) have been computed or not.
Definition: HRICS_MultiAgentGrid.hpp:106
bool isBoundary(void)
true if this cell is a boundary for this agent, i.e.
Definition: HRICS_MultiAgentGrid.hpp:562
Definition: TwoDGrid.hpp:25
void draw()
drawing the grid
Definition: HRICS_MultiAgentGrid.cpp:421
API::Trajectory * trajB
owned by this, deleted when this is deleted
Definition: HRICS_MultiAgentGrid.hpp:885
void initAllTrajs()
call resetTrajs() in each cell
Definition: HRICS_MultiAgentGrid.cpp:716
void initCylinders(void)
init agents cylinders for reachability computation.
Definition: HRICS_MultiAgentGrid.cpp:353
double getSpeed(void)
for cost computation.
Definition: HRICS_MultiAgentGrid.hpp:104
bool isAccessibilityComputed()
whether the accessibility have been computed or is unknown
Definition: HRICS_MultiAgentGrid.hpp:537
AgentInGrid * agentInGrid
pointer to the AgentInGrid structure in the Grid
Definition: HRICS_MultiAgentGrid.hpp:531
Definition: HRICS_MultiAgentGrid.hpp:468
Definition: trajectory.hpp:40
std::deque< double > distance_alternatives
distances of this cell from cell origin_alternatives (others online defined cells) ...
Definition: HRICS_MultiAgentGrid.hpp:554
Plannar HRI Cell.
Definition: HRICS_MultiAgentGrid.hpp:462
void computeDistances()
using the method of distance propagation to compute distances.
Definition: HRICS_MultiAgentGrid.cpp:748
std::vector< MultiAgentCell * > & boundaries()
a subset of reachable where all cells are near an obstacle (have a not accesscible neighbour) ...
Definition: HRICS_MultiAgentGrid.hpp:53
std::vector< MultiAgentCell * > & frontiers(MetaAgentInGrid::s_ptr other)
the cells that are frontiers for the agent with other agents
Definition: HRICS_MultiAgentGrid.hpp:55
std::vector< MultiAgentCell * > & boundaries()
a subset of reachable where all cells are near an obstacle (have a not accesscible neighbour) ...
Definition: HRICS_MultiAgentGrid.hpp:98
void setAgents(std::vector< Robot * > &agents)
set the agents list to use in this HRI computation.
Definition: HRICS_MultiAgentGrid.cpp:192
FrontierPtr neighbourFrontier(double keep_distance, double min_distance=0)
create or find a similar frontier, changing positions of agents
Definition: HRICS_MultiAgentGrid.cpp:2487
double getDistanceAny(unsigned int agent, MultiAgentCell *other)
get distance either using getDistance or getAltDistance, on this or other according to the origins se...
Definition: HRICS_MultiAgentGrid.cpp:2127
Robot * getRobot()
pointer to the robot.
Definition: HRICS_MultiAgentGrid.hpp:85
Definition: HRICS_MultiAgentGrid.hpp:857
bool isReachable()
check if the meta agent is correctly set, if it is, return reachability status, false otherwise meta ...
Definition: HRICS_MultiAgentGrid.hpp:543
double getMaxDist()
the maximum distance the agent can cover (for display purpose, computed during distance computation)...
Definition: HRICS_MultiAgentGrid.hpp:88
FrontierCells::FrontierCheckStatus r_check_status
the results of the tests are in object_ok, grab_confs_ok, handover_ok
Definition: HRICS_MultiAgentGrid.hpp:874
Holds all the data concerning an agent in the MultiAgentGrid class.
Definition: HRICS_MultiAgentGrid.hpp:83
void setReachability(bool b)
set the reachability of the corresponging meta agent, ABORT otherwise
Definition: HRICS_MultiAgentGrid.hpp:547
void addPoint(double Rz)
add a point to the random vector in order to draw it (the red arrows)
FrontierPtr getRealFrontier(unsigned int a1, unsigned int a2, MetaFrontierPtr mfrontier)
returns the real Frontier that is a specification of the MetaFrontier mfrontier returns empty ptr if ...
Definition: HRICS_MultiAgentGrid.cpp:2259
std::pair< unsigned int, unsigned int > getFrontierAgentIndices(unsigned int i)
the reverse of getFrontierIndex().
Definition: HRICS_MultiAgentGrid.cpp:1843
std::vector< MultiAgentCell * > getCrown(double min, double max)
return the crown arround the cell taking the min and max value
void deSymetrize()
use this when the frontiers diverge according to its direction it duplicates data to their "reverse" ...
Definition: HRICS_MultiAgentGrid.cpp:2613
std::vector< std::tr1::shared_ptr< FrontierCells > > createAllRealFrontiersFor(unsigned int a1, unsigned int a2)
calls createRealFrontierFor(a1,a2,meta) for each meta frontier in which a1 and a2 are concerned ...
Definition: HRICS_MultiAgentGrid.cpp:2199
double computeDist(MultiAgentCell *neighCell)
compute distance between two cells
Definition: HRICS_MultiAgentGrid.cpp:2388
HRI_AGENT * getHriAgent()
return hri_agent related to the robot if possible
Definition: robot.cpp:107
std::tr1::shared_ptr< Configuration > r_object_position
a position of the object where it may be reachable by the two agents (when from B to A) ...
Definition: HRICS_MultiAgentGrid.hpp:881
bool checkMetaAgent(unsigned int index)
return true if meta agent is OK, false if it have been changed
Definition: HRICS_MultiAgentGrid.cpp:1981