Go to the documentation of this file.
18 setObjectType(kWorldObject);
69 from = aMap->GetNodeFromMap(x, y);
71 Locs[which]->getLocation(tox, toy);
73 to = aMap->GetNodeFromMap(tox, toy);
79 pathCost = aMap->distance(p);
87 GLdouble xx, yy, zz, rad;
89 int posx = x, posy = y;
92 glBegin(GL_LINE_STRIP);
94 glVertex3f(xx, yy, zz-rad/2);
95 for (
int t =
moves.size()-1; t >= 0; t--)
103 glVertex3f(xx, yy, zz-rad/2);
109 drawSphere(xx, yy, zz, rad);
128 if ((p == NULL) || (p->
next == NULL))
143 case -1: result =
kE;
break;
145 case 1: result =
kW;
break;
147 printf(
"SU: %s : The (x) nodes in the path are not next to each other!\n",
149 printf(
"Distance is %ld\n",
151 std::cout << *p->
n <<
"\n" << *p->
next->
n <<
"\n";
159 case -1: result = result|
kS;
break;
161 case 1: result = result|
kN;
break;
163 printf(
"SU: %s : The (y) nodes in the path are not next to each other!\n",
165 printf(
"Distance is %ld\n",
167 std::cout << *p->
n <<
"\n" << *p->
next->
n <<
"\n";
178 printf(
"Error; somehow nodes touched/expanded are inconsistent. t:%d e:%d\n",
virtual Map * GetMap() const =0
virtual void LogFinalStats(StatCollection *)
virtual MapAbstraction * GetMapAbstraction()=0
double goToLoc(MapAbstraction *aMap, int which)
void OpenGLDraw(const MapProvider *, const SimulationInfo *) const
uint64_t GetNodesTouched()
virtual tDirection makeMove(MapProvider *, reservationProvider *, SimulationInfo *simInfo)
** Creates a patrol unit and assigns it numPLocations random locations to patrol.
void addPathToCache(path *p)
std::vector< tDirection > moves
void LogFinalStats(StatCollection *stats)
log any final one-time stats before a simulation is ended
The StatCollection class is for collecting stats across different parts of the simulation.
void addPatrolLocation(unit *)
void AddStat(const char *category, const char *owner, double value)
Add a new stat entry for the given category, owner and value.
path * GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
bool GetOpenGLCoord(int _x, int _y, GLdouble &x, GLdouble &y, GLdouble &z, GLdouble &radius) const
Get the openGL coordinates of a given tile.
std::vector< unit * > Locs
long GetLabelL(unsigned int index) const
A linked list of nodes which form a continuous path.
void LogStats(StatCollection *stats)
log an stats that may have been computed during the last run
uint64_t GetNodesExpanded()
virtual const char * GetName()
Nodes to be stored within a Graph.
A tile-based representation of the world.