7 enum faultdetectionmodeltype {CRM, CRM_TCELLSINEXCESS, CTRNN, LINEQ};
9 #define FDMODELTYPE CRM_TCELLSINEXCESS //CRM
14 #define MODELSTARTTIME 450
20 #define FLOATINGPOINTOPERATIONS
41 typedef list<CAgent*> TAgentList;
42 typedef list<CAgent*>::iterator TAgentListIterator;
43 typedef list<TAgentList*> TAgentListList;
44 typedef list<TAgentList*>::iterator TAgentListListIterator;
46 typedef vector<CAgent*> TAgentVector;
47 typedef vector<CAgent*>::iterator TAgentVectorIterator;
82 CAgent(
const char* pch_name,
unsigned int un_identification,
CArguments* pc_arguments);
86 virtual const TVector2d* GetPosition()
const;
89 virtual void SetPosition(
TVector2d* pt_new_position);
92 virtual const TVector2d* GetVelocity()
const;
95 virtual const TVector2d* GetAcceleration()
const;
98 virtual double GetAngularVelocity();
101 virtual double GetAngularAcceleration();
104 virtual void SetVelocity(
TVector2d* pt_velocity_position);
107 virtual void GetRelativeVelocity(
double* mag_relvelocity,
double* dir_relvelocity,
double feature_range);
110 virtual void GetRelativeAcceleration(
double *mag_relacceleration,
double *dir_relacceleration,
double feature_range);
119 virtual void SimulationStep(
unsigned int n_step_number);
120 virtual void SimulationStepUpdatePosition();
122 virtual void SetMaximumSpeed(
double f_max_speed);
123 virtual double GetMaximumSpeed()
const;
125 virtual double GetMaximumAngularVelocity()
const;
127 static unsigned int g_unGlobalNumberOfAgentsCreated;
129 virtual unsigned int GetColor();
130 virtual void SetColor(
unsigned int un_index);
132 virtual double GetSize();
134 virtual EAgentType GetType() = 0;
137 virtual inline unsigned int GetIdentification() {
return m_unIdentification;}
139 virtual void SetBehavIdentification(
int i_behavidentification);
140 virtual int GetBehavIdentification();
142 bool m_bTempWithInRange;
143 double m_fTempDistance;
145 static double RADIUS;
147 virtual CAgent* GetClosestAgent(
double f_range, EAgentType e_type);
149 virtual TVector2d GetCenterOfMassOfSurroundingAgents(
double f_range, EAgentType e_type);
150 virtual double GetAverageDistanceToSurroundingAgents(
double f_range, EAgentType e_type);
151 virtual TVector2d GetAverageVelocityOfSurroundingAgents(
double f_range, EAgentType e_type);
152 virtual TVector2d GetAverageAccelerationOfSurroundingAgents(
double f_range, EAgentType e_type);
153 virtual void MarkAgentsWithinRange(TAgentListList* ptlist_agent_list_list,
double f_range, EAgentType e_type);
154 virtual CAgent* GetRandomAgentWithinRange(TAgentListList* ptlist_agent_list_list,
double f_range, EAgentType e_type);
155 virtual unsigned int CountAgentsInAgentListList(TAgentListList* ptlist_agent_list_list,
double f_range, EAgentType e_type);
156 virtual unsigned int CountAgents(
double f_range, EAgentType e_type);
158 virtual void SetRandomVelocity();
159 virtual void MoveTowards(
TVector2d t_position,
double f_max_speed);
161 virtual void SortAllAgentsAccordingToDistance(TAgentVector* pt_result);
169 double m_fMaximumSpeed;
170 double m_fMaximumPhysicalRange_Recruitment;
172 double m_tAngularVelocity;
173 double m_tAngularAcceleration;
175 EControllerType m_eControllerType;
177 bool m_bInteractable;
179 unsigned int m_unIdentification;
181 unsigned int m_iBehavIdentification;
183 unsigned int m_unColor;
185 double m_fProportionalDirectionNoise;
186 double m_fProportionalMagnitudeNoise;