RepastHPC  2.3.1
BaseGrid.h
1 /*
2  * Repast for High Performance Computing (Repast HPC)
3  *
4  * Copyright (c) 2010 Argonne National Laboratory
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with
8  * or without modification, are permitted provided that the following
9  * conditions are met:
10  *
11  * Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * Neither the name of the Argonne National Laboratory nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR
26  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  *
35  * Grid.h
36  *
37  * Created on: Jun 19, 2009
38  * Author: nick
39  */
40 
41 #ifndef BASE_GRID_H_
42 #define BASE_GRID_H_
43 
44 #include <vector>
45 #include <iostream>
46 #include <math.h>
47 #include <exception>
48 
49 #include <boost/unordered_map.hpp>
50 #include <boost/shared_ptr.hpp>
51 #include <boost/iterator.hpp>
52 #include <boost/iterator/transform_iterator.hpp>
53 
54 #include "Grid.h"
55 #include "spatial_math.h"
56 #include "RepastErrors.h"
57 
58 namespace repast {
59 
63 template<typename T, typename GPType>
65 
66  bool inGrid;
67  Point<GPType> point;
68  boost::shared_ptr<T> ptr;
69 
70  GridPointHolder() :
71  inGrid(false), point(0) {
72  }
73 };
74 
79 template<typename T, typename GPType>
80 struct AgentFromGridPoint: public std::unary_function<typename boost::unordered_map<AgentId,
81  GridPointHolder<T, GPType>*>::value_type, boost::shared_ptr<T> > {
82  boost::shared_ptr<T> operator()(
83  const typename boost::unordered_map<AgentId, GridPointHolder<T, GPType>*>::value_type& value) const {
84  GridPointHolder<T, GPType> *gp = value.second;
85  return gp->ptr;
86  }
87 
88 };
89 
103 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
104 class BaseGrid: public Grid<T, GPType> {
105 
106 private:
107 
108  // we use a GridPointHolder so we can swap out the GridPoint for an
109  // agent with a single map access, rather than have to put the new
110  // GridPoint back in the map.
111  typedef typename boost::unordered_map<AgentId, GridPointHolder<T, GPType>*, HashId> AgentLocationMap;
112 
113  AgentLocationMap agentToLocation;
114  GridDimensions dimensions_;
115 
116  CellAccessor cellAccessor;
117 
118  bool doMove(std::vector<GPType>& point, GridPointHolder<T, GPType>* gpHolder);
119 
120  size_t size_;
121 
122 protected:
123 
124  typedef typename AgentLocationMap::iterator LocationMapIter;
125  typedef typename AgentLocationMap::const_iterator LocationMapConstIter;
126 
127  GPTransformer gpTransformer;
128  Adder adder;
129 
130  virtual bool addAgent(boost::shared_ptr<T> agent);
131  virtual void removeAgent(T* agent);
132 
133  LocationMapConstIter locationsBegin() const {
134  return agentToLocation.begin();
135  }
136  LocationMapConstIter locationsEnd() const {
137  return agentToLocation.end();
138  }
139 
140  T* get(const AgentId& id);
141 
142 public:
143 
147  typedef typename boost::transform_iterator<AgentFromGridPoint<T, GPType> , LocationMapConstIter> const_iterator;
148 
155  BaseGrid(std::string name, GridDimensions dimensions);
156  virtual ~BaseGrid();
157 
158  // doc inherited from Grid
159  virtual bool contains(const AgentId& id);
160 
161  // doc inherited from Grid
162  virtual bool getLocation(const T* agent, std::vector<GPType>& pt) const;
163 
164  // doc inherited from Grid
165  virtual bool getLocation(const AgentId& id, std::vector<GPType>& out) const;
166 
167  // doc inherited from Grid
168  virtual T* getObjectAt(const Point<GPType>& pt) const;
169 
170  // doc inherited from Grid
171  virtual void getObjectsAt(const Point<GPType>& pt, std::vector<T*>& out) const;
172 
184  virtual bool moveTo(const T* agent, const std::vector<GPType>& newLocation);
185 
197  virtual bool moveTo(const T* agent, const Point<GPType>& newLocation);
198 
210  virtual bool moveTo(const AgentId& id, const std::vector<GPType>& newLocation);
211 
212  // doc inherited from Grid
213  virtual bool moveTo(const AgentId& id, const Point<GPType>& pt);
214 
215  // doc inherited from Grid
216  virtual std::pair<bool, Point<GPType> > moveByDisplacement(const T* agent, const std::vector<GPType>& displacement);
217 
219  virtual std::pair<bool, Point<GPType> > moveByVector(const T* agent, double distance,
220  const std::vector<double>& anglesInRadians);
221 
230  virtual const_iterator begin() const {
231  return const_iterator(agentToLocation.begin());
232  }
233 
239  virtual const_iterator end() const {
240  return const_iterator(agentToLocation.end());
241  }
242 
248  virtual size_t size() const {
249  return size_;
250  }
251 
252  // doc inherited from Grid
253  virtual double getDistance(const Point<GPType>& pt1, const Point<GPType>& pt2) const;
254 
255  // doc inherited from Grid
256  virtual double getDistanceSq(const Point<GPType>& pt1, const Point<GPType>& pt2) const;
257 
258  // doc inherited from Grid
259  virtual void getDisplacement(const Point<GPType>& pt1, const Point<GPType>& pt2, std::vector<GPType>& out) const;
260 
261  // doc inherited from Grid
262  virtual const GridDimensions dimensions() const {
263  return dimensions_;
264  }
265 
266  // doc inherited from Grid
267  virtual void translate(const Point<GPType>& location, const Point<GPType>& displacement, std::vector<GPType>& out) const {
268  gpTransformer.translate(location.coords(), out, displacement.coords());
269  }
270 
271  // doc inherited from Grid
272  virtual void transform(const std::vector<GPType>& location, std::vector<GPType>& out) const {
273  gpTransformer.transform(location, out);
274  }
275 
276  // doc inherited from Grid
277  virtual bool isPeriodic() const {
278  return gpTransformer.isPeriodic();
279  }
280 
281  virtual ProjectionInfoPacket* getProjectionInfo(AgentId id, bool secondaryInfo = false, std::set<AgentId>* secondaryIds = 0, int destProc = -1 );
282 
283  virtual void updateProjectionInfo(ProjectionInfoPacket* pip, Context<T>* context);
284 
285  virtual void getAgentsToPush(std::set<AgentId>& agentsToTest, std::map<int, std::set<AgentId> >& agentsToPush){ }
286  virtual void getInfoExchangePartners(std::set<int>& psToSendTo, std::set<int>& psToReceiveFrom) {}
287  virtual void getAgentStatusExchangePartners(std::set<int>& psToSendTo, std::set<int>& psToReceiveFrom) {}
288 };
289 
290 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
292  Grid<T, GPType> (name), gpTransformer(dimensions), dimensions_(dimensions), size_(0) {
293 // gpTransformer.init(dimensions);
294  adder.init(dimensions, this);
295 }
296 
297 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
299  for (LocationMapIter iter = agentToLocation.begin(); iter != agentToLocation.end(); ++iter) {
300  delete iter->second;
301  }
302 }
303 
304 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
305 T* BaseGrid<T, CellAccessor, GPTransformer, Adder, GPType>::get(const AgentId& id) {
306  LocationMapConstIter iter = agentToLocation.find(id);
307  if (iter == agentToLocation.end())
308  return 0;
309 
310  return iter->second->ptr.get();
311 }
312 
313 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
314 bool BaseGrid<T, CellAccessor, GPTransformer, Adder, GPType>::getLocation(const AgentId& id, std::vector<GPType>& out) const {
315  LocationMapConstIter iter = agentToLocation.find(id);
316  if (iter == agentToLocation.end())
317  return false;
318 
319  GridPointHolder<T, GPType>* holder = iter->second;
320  if (!holder->inGrid)
321  return false;
322 
323  if (out.size() != dimensions_.dimensionCount())
324  out.resize(dimensions_.dimensionCount(), 0);
325  holder->point.copy(out);
326  return true;
327 
328 }
329 
330 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
331 bool BaseGrid<T, CellAccessor, GPTransformer, Adder, GPType>::getLocation(const T* agent, std::vector<GPType>& out) const {
332  return getLocation(agent->getId(), out);
333 }
334 
335 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
337  return agentToLocation.find(id) != agentToLocation.end();
338 }
339 
340 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
342  return moveTo(agent->getId(), newLocation.coords());
343 }
344 
345 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
347  const std::vector<GPType>& newLocation) {
348  return moveTo(agent->getId(), newLocation);
349 }
350 
351 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
353  const Point<GPType>& newLocation) {
354  return moveTo(id, newLocation.coords());
355 }
356 
357 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
359  const std::vector<GPType>& newLocation) {
360  LocationMapIter iter = agentToLocation.find(id);
361 
362  if (iter == agentToLocation.end())
363  throw Repast_Error_2<AgentId>(id, Projection<T>::name()); // Agent has not yet been introduced to this space/is not present
364 
365  if (newLocation.size() < dimensions_.dimensionCount())
366  throw Repast_Error_3(newLocation.size(), dimensions_.dimensionCount()); // Destination not fully specified
367 
368  std::vector<GPType> transformedCoords(newLocation.size(), 0);
369  gpTransformer.transform(newLocation, transformedCoords);
370 
371  if (iter->second->point.coords() == transformedCoords) return true;
372  return doMove(transformedCoords, iter->second);
373 }
374 
375 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
377  GPType>* gpHolder) {
378  Point<GPType> pt(location);
379  if (cellAccessor.put(gpHolder->ptr, pt)) {
380  if (gpHolder->inGrid) {
381  cellAccessor.remove(gpHolder->ptr, gpHolder->point);
382  } else {
383  size_++;
384  gpHolder->inGrid = true;
385  }
386  gpHolder->point = pt;
387  return true;
388  }
389  return false;
390 }
391 
392 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
393 std::pair<bool, Point<GPType> > BaseGrid<T, CellAccessor, GPTransformer, Adder, GPType>::moveByVector(const T* agent,
394  double distance, const std::vector<double>& anglesInRadians) {
395  if (anglesInRadians.size() != dimensions_.dimensionCount())
396  throw Repast_Error_4(anglesInRadians.size(), dimensions_.dimensionCount()); // Number of angles must equal dimensions
397 
398  std::vector<GPType> pt = calculateDisplacement<GPType> (dimensions_.dimensionCount(), 0, distance, anglesInRadians);
399  return moveByDisplacement(agent, pt);
400 }
401 
402 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
404  const T* agent, const std::vector<GPType>& displacement) {
405  if (displacement.size() != dimensions_.dimensionCount())
406  throw Repast_Error_5(displacement.size(), dimensions_.dimensionCount()); // displacement vector must equal number of grid/space dimensions
407 
408  LocationMapIter iter = agentToLocation.find(agent->getId());
409  if (iter == agentToLocation.end())
410  throw Repast_Error_6<AgentId>(agent->getId(), Projection<T>::name()); // Agent has not in this grid / space
411 
412  GridPointHolder<T, GPType>* gpHolder = iter->second;
413  std::vector<GPType> newPos(displacement.size(), 0);
414  gpTransformer.translate(gpHolder->point.coords(), newPos, displacement);
415  std::vector<GPType> transformedCoords(newPos.size(), 0);
416  gpTransformer.transform(newPos, transformedCoords);
417  if (iter->second->point.coords() == transformedCoords)
418  return std::make_pair(true, Point<GPType> (transformedCoords));
419  return std::make_pair(moveTo(agent->getId(), transformedCoords), Point<GPType> (transformedCoords));
420 }
421 
422 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
424  return cellAccessor.get(pt);
425 }
426 
427 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
429  std::vector<T*>& out) const {
430  return cellAccessor.getAll(pt, out);
431 }
432 
433 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
435  if(!Projection<T>::agentCanBeAdded(agent)) return false;
437  gp->ptr = agent;
438  agentToLocation[agent->getId()] = gp;
439  return adder.add(agent);
440 }
441 
442 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
443 void BaseGrid<T, CellAccessor, GPTransformer, Adder, GPType>::removeAgent(T* agent) {
444  LocationMapIter iter = agentToLocation.find(agent->getId());
445  if (iter != agentToLocation.end()) {
446  GridPointHolder<T, GPType>* gp = iter->second;
447  cellAccessor.remove(gp->ptr, gp->point);
448  delete gp;
449  agentToLocation.erase(iter);
450  }
451 }
452 
453 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
455  GPType>& pt2) const {
456  return sqrt(getDistanceSq(pt1, pt2));
457 }
458 
459 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
461  GPType>& pt2) const {
462  if (pt1.dimensionCount() != pt2.dimensionCount())
463  throw Repast_Error_7(pt1.dimensionCount(), pt2.dimensionCount()); // Points do not have same number of dimensions
464 
465  double sum = 0;
466  for (int i = 0, n = pt1.dimensionCount(); i < n; i++) {
467  double diff = pt1.getCoordinate(i) - pt2.getCoordinate(i);
468  if (gpTransformer.isPeriodic()) {
469  double dim = dimensions_.extents(i);
470  double absDiff = ((diff < 0.00) ? (-1.0 * diff) : diff); //abs(diff);
471  if (absDiff > dim / 2.0) diff = dim - absDiff;
472  }
473  sum += diff * diff;
474  }
475 
476  return sum;
477 }
478 
479 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
481  GPType>& pt2, std::vector<GPType>& out) const {
482  if (pt1.dimensionCount() != pt2.dimensionCount())
483  throw Repast_Error_8(pt1.dimensionCount(), pt2.dimensionCount()); // Points do not have same number of dimensions
484 
485  for (int i = 0, n = pt1.dimensionCount(); i < n; i++) {
486  GPType diff = pt2.getCoordinate(i) - pt1.getCoordinate(i);
487  if (gpTransformer.isPeriodic()) {
488  double dim = dimensions_.extents(i);
489  GPType absDiff = ((diff < 0.00) ? (-1.0 * diff) : diff); //abs(diff);
490  if (absDiff > dim / ((GPType) 2)) diff = dim - absDiff;
491  }
492  out[i] = diff;
493  }
494 }
495 
496 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
498  std::set<AgentId>* secondaryIds, int destProc){
499  typename AgentLocationMap::const_iterator agentIter = agentToLocation.find(id);
500  if(agentIter == agentToLocation.end()){
501  return 0;
502  }
503  else{
504  return new SpecializedProjectionInfoPacket<GPType>(id, agentIter->second->point.coords());
505  }
506 }
507 
508 
509 template<typename T, typename CellAccessor, typename GPTransformer, typename Adder, typename GPType>
510 void BaseGrid<T, CellAccessor, GPTransformer, Adder, GPType>::updateProjectionInfo(ProjectionInfoPacket* pip, Context<T>* context){
511  SpecializedProjectionInfoPacket<GPType>* spip = static_cast<SpecializedProjectionInfoPacket<GPType>*>(pip);
512  moveTo(spip->id, spip->data);
513 // std::cout << " UPDATING PROJECTION INFO: " << spip->id << " " << spip->data[0] << "," << spip->data[1] << " " << context->getAgent(spip->id)->location() << std::endl;
514 }
515 
516 }
517 
518 #endif /* GRID_H_ */
repast::BaseGrid::translate
virtual void translate(const Point< GPType > &location, const Point< GPType > &displacement, std::vector< GPType > &out) const
Translates the specified location by the specified displacement put the result in out.
Definition: BaseGrid.h:267
repast::Context
Collection of agents of type T with set semantics.
Definition: Context.h:82
repast::ProjectionInfoPacket
Serializable packet that can contain projection information regardless of the type of projection (net...
Definition: Projection.h:64
repast::GridPointHolder
Encapsulates a grid point and what is held in it.
Definition: BaseGrid.h:64
repast::AgentFromGridPoint
Unary function used in the transform_iterator that allows context iterators to return the agent maps ...
Definition: BaseGrid.h:80
repast::AgentId
Agent identity information.
Definition: AgentId.h:60
repast::BaseGrid::getObjectAt
virtual T * getObjectAt(const Point< GPType > &pt) const
Gets the first object found at the specified point, or NULL if there is no such object.
Definition: BaseGrid.h:423
repast::BaseGrid::contains
virtual bool contains(const AgentId &id)
Gets whether or not this grid contains the agent with the specified id.
Definition: BaseGrid.h:336
repast::BaseGrid::getObjectsAt
virtual void getObjectsAt(const Point< GPType > &pt, std::vector< T * > &out) const
Gets all the objects found at the specified point.
Definition: BaseGrid.h:428
repast::Point::getCoordinate
T getCoordinate(int coordIndex) const
Gets the coodinate of the point in the specified dimension.
Definition: Point.h:320
repast::BaseGrid::moveTo
virtual bool moveTo(const T *agent, const std::vector< GPType > &newLocation)
Moves the specified agent to the specified location.
Definition: BaseGrid.h:346
repast::BaseGrid::getDistanceSq
virtual double getDistanceSq(const Point< GPType > &pt1, const Point< GPType > &pt2) const
Gets the square of the distance between the two grid points.
Definition: BaseGrid.h:460
repast::BaseGrid::getDisplacement
virtual void getDisplacement(const Point< GPType > &pt1, const Point< GPType > &pt2, std::vector< GPType > &out) const
Gets vector difference between point 1 and point 2, putting the result in out.
Definition: BaseGrid.h:480
repast::Projection
Abstract base class for all Projections.
Definition: Projection.h:125
repast::BaseGrid::isPeriodic
virtual bool isPeriodic() const
Gets whether or not this grid is periodic (i.e.
Definition: BaseGrid.h:277
repast::Grid
Abstract interface for Grids and ContinuousSpaces.
Definition: Grid.h:62
repast::BaseGrid::getInfoExchangePartners
virtual void getInfoExchangePartners(std::set< int > &psToSendTo, std::set< int > &psToReceiveFrom)
Gets the set of processes with which this Projection exchanges projection info.
Definition: BaseGrid.h:286
repast::BaseGrid::moveByVector
virtual std::pair< bool, Point< GPType > > moveByVector(const T *agent, double distance, const std::vector< double > &anglesInRadians)
doc inherited from Grid
Definition: BaseGrid.h:393
repast::GridDimensions
Basic structure for specifying grid dimenions.
Definition: GridDimensions.h:58
repast::BaseGrid::getAgentsToPush
virtual void getAgentsToPush(std::set< AgentId > &agentsToTest, std::map< int, std::set< AgentId > > &agentsToPush)
Given a set of agents, gets the agents that this projection implementation must 'push' to other proce...
Definition: BaseGrid.h:285
repast::BaseGrid::size
virtual size_t size() const
Gets the number of agents in this BaseGrid.
Definition: BaseGrid.h:248
repast::BaseGrid::getAgentStatusExchangePartners
virtual void getAgentStatusExchangePartners(std::set< int > &psToSendTo, std::set< int > &psToReceiveFrom)
Gets the set of processes with which this Projection exchanges agent status info- that is,...
Definition: BaseGrid.h:287
repast::Point::copy
void copy(std::vector< T > &out) const
Copies the point into the specified vector.
Definition: Point.h:325
repast::BaseGrid::begin
virtual const_iterator begin() const
Gets an iterator over the agents in this BaseGrid starting with the first agent.
Definition: BaseGrid.h:230
repast::BaseGrid::dimensions
virtual const GridDimensions dimensions() const
Gets the dimensions of this Grid.
Definition: BaseGrid.h:262
repast::BaseGrid::getDistance
virtual double getDistance(const Point< GPType > &pt1, const Point< GPType > &pt2) const
Gets the distance between the two grid points.
Definition: BaseGrid.h:454
repast::Point::dimensionCount
size_t dimensionCount() const
Gets the number of dimensions of this point.
Definition: Point.h:196
repast::BaseGrid::transform
virtual void transform(const std::vector< GPType > &location, std::vector< GPType > &out) const
Transforms the specified location using the properties (e.g.
Definition: BaseGrid.h:272
repast::BaseGrid
Base grid implementation, implementing elements common to both Grids and ContinuousSpaces.
Definition: BaseGrid.h:104
repast::Point::coords
const std::vector< T > & coords() const
Gets the coordinates of this point as a vector.
Definition: Point.h:229
repast::HashId
operator() implementation that returns the hashcode of an AgentId.
Definition: AgentId.h:185
repast::BaseGrid::moveByDisplacement
virtual std::pair< bool, Point< GPType > > moveByDisplacement(const T *agent, const std::vector< GPType > &displacement)
Moves the specified object from its current location by the specified amount.
Definition: BaseGrid.h:403
repast::BaseGrid::BaseGrid
BaseGrid(std::string name, GridDimensions dimensions)
Creates a BaseGrid with the specified name and dimensions.
Definition: BaseGrid.h:291
repast::Point< GPType >
repast::BaseGrid::getLocation
virtual bool getLocation(const T *agent, std::vector< GPType > &pt) const
Gets the location of this agent and puts it in the specified vector.
Definition: BaseGrid.h:331
repast::Projection::name
const std::string name() const
Gets the name of this projection.
Definition: Projection.h:164
repast::BaseGrid::const_iterator
boost::transform_iterator< AgentFromGridPoint< T, GPType >, LocationMapConstIter > const_iterator
A const iterator over shared_ptr<T>.
Definition: BaseGrid.h:147
repast::BaseGrid::end
virtual const_iterator end() const
Gets the end of an iterator over the agents in this BaseGrid.
Definition: BaseGrid.h:239