BioinstSim  2
 All Classes Functions Variables
arena.h
1 #ifndef ARENA_H_
2 #define ARENA_H_
3 
4 /******************************************************************************/
5 /******************************************************************************/
6 
7 #include "common.h"
8 #include "agent.h"
9 
10 /******************************************************************************/
11 /******************************************************************************/
12 
13 class CArena : public CSimObject
14 {
15 public:
16  CArena(const char* pch_name,
17  double f_size_x,
18  double f_size_y,
19  unsigned int un_res_x,
20  unsigned int un_res_y);
21  virtual ~CArena();
22 
23  virtual void GetSize(double* pf_size_x, double* pf_size_y) const;
24  virtual void GetResolution(unsigned int* pun_res_x, unsigned int* pun_res_y) const;
25 
26  virtual void GetAgentsCloseTo(TAgentListList* pt_output_list, const TVector2d* pt_position, double f_radius);
27 
28  virtual void AddAgent(CAgent* pc_agent, TVector2d* pt_new_position);
29  virtual void RemoveAgent(CAgent* pc_agent);
30  virtual void MoveAgent(CAgent* pc_agent, TVector2d* pt_new_position);
31 
32  virtual bool IsObstacle(TVector2d* t_position) = 0;
33 
34  static bool g_bIsBoundless;
35 
36 protected:
37  unsigned int XYToArrayPosition(const TVector2d* pt_position) const;
38  unsigned int XYToArrayPosition(double f_x, double f_y) const;
39  void XYToArrayXY(double f_x, double f_y, unsigned int* pun_x, unsigned int* pun_y) const;
40 
41  TAgentListIterator FindAgent(TAgentList* plist_agents, CAgent* pc_agent) const;
42 
43  virtual void RemoveAgent(CAgent* pc_agent, unsigned int un_array_position);
44  virtual void AddAgent(CAgent* pc_agent, unsigned int un_array_position);
45 
46 
47 protected:
48  double m_fSizeX;
49  double m_fSizeY;
50 
51  unsigned int m_unResX;
52  unsigned int m_unResY;
53 
54  // A m_unResX * m_unResY array of agents in the corresponding squares.
55  TAgentList* m_plistAgents;
56 
57  unsigned int m_unNumberOfCytokineConcentrations;
58 };
59 
60 /******************************************************************************/
61 /******************************************************************************/
62 
63 #endif