-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBiomarker.h
267 lines (220 loc) · 7.68 KB
/
Biomarker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/*
* Biomarker.h
* Copyright (c) 2024 Technische Universität Berlin
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Created on: 2024. 03. 04.
* Author: Saswati Pal <saswati.pal@tu-berlin.de>
*/
#ifndef CLASS_BIOMARKER_
#define CLASS_BIOMARKER_
#include "ns3/object.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include <iostream>
#include <vector>
#include "BiomarkerNetDevice.h"
#include "BiomarkerChannel.h" // Include BiomarkerChannel
// Forward declaration of BiomarkerChannel
namespace ns3 {
class BiomarkerChannel;
class Bloodvessel;
}
namespace ns3 {
class BiomarkerNetDevice;
class Biomarker;
/**
* \brief Biomarker is a mobile Object representing a biological indicator within a Bloodvessel (biological marker circulating in the bloodstream).
* Each Biomarker has a position within a Bloodvessel and can be detected by Nanobots.
* It carries information about its source (e.g., infection type).
* Biomarker has attributes such as position, size, and active time.
* A Biomarker belongs to a particular stream within a specific Bloodvessel.
* It will be removed from the simulation after a certain active time.
*/
class Biomarker : public ns3::Object {
private:
string m_biomarkerID; // Unique identifier for the biomarker
// int m_biomarkerID;
double m_size; // Size of the biomarker
string m_type; // Type of biomarker, linked to infection source
string m_sourceData; // Data associated with the infection source
double m_decayRate;
Ptr<Bloodvessel> m_bloodvessel;
int m_stream_bm; // Stream within the blood vessel where the biomarker is located
bool m_shouldChange; // Flag indicating if the biomarker should change streams (might not be necessary)
ns3::Time m_timeStep; // Simulation time of the last change in position
ns3::Time m_activeTime; // Duration the biomarker remains active in the simulation
ns3::Time m_creationTime; // Time when the biomarker was created
Ptr<Node> bm_node; // Node representing the biomarker's position
Ptr<BiomarkerNetDevice> m_biomarkerNetDevice; // Communication device
Ptr<MobilityModel> m_mobilityModel; // Pointer to mobility model
public:
/// Constructor to initialize values of all variables.
/// The BiomarkerID is set in bloodcircuit, where the Biomarkers are initialized.
Biomarker();
/// Destructor
~Biomarker();
///Getter and setter methods
/**
* \returns the Biomarker Id.
*/
string GetBiomarkerID();
/**
* \param idbio a Biomarker Id.
*
* A Biomarker has a unique Id.
*/
void SetBiomarkerID(string idbio);
/**
* \brief Retrieves the size of the biomarker.
*
* \return The size of the biomarker as a double value.
*/
double GetSize();
/**
* \brief Sets the size of the biomarker.
*
* \param size The size to be assigned to the biomarker.
*/
void SetSize(double size);
/**
* \brief Retrieves the type of the biomarker.
*
* The type is usually associated with the source of infection.
*
* \return The type of the biomarker as a string.
*/
string GetType();
/**
* \brief Sets the type of the biomarker.
*
* \param type The type to be assigned to the biomarker.
*/
void SetType(string& type);
/**
* \brief Retrieves the source data associated with the biomarker.
*
* This data might represent specific information about the infection source.
*
* \return The source data as a string.
*/
string GetSourceData();
/**
* \brief Sets the source data for the biomarker.
*
* \param data The data to be associated with the biomarker.
*/
void SetSourceData(string& data);
/**
* \brief Sets the Bloodvessel object that contains this biomarker.
*
* \param bloodvessel A pointer to the Bloodvessel object where this biomarker is located.
*/
void SetBloodvessel(Ptr<Bloodvessel> bloodvessel);
/**
* \brief Gets the Bloodvessel object that contains this biomarker.
*
* \return A pointer to the Bloodvessel object where this biomarker is located.
*/
Ptr<Bloodvessel> GetBloodvessel();
/**
* \returns the stream of the Biomarker.
*/
int GetStream();
/**
* \param streamId the stream of the Biomarker.
*/
void SetStream(int streamId);
/**
* \returns true if the Biomarker should change streams.
*/
bool GetShouldChange(); // Optional, if you need stream changing behavior
/**
* \param shouldChangeStream True if the biomarker should change streams.
*/
void SetShouldChange(bool shouldChangeStream);
/**
* \returns the time of the last change of Biomarker's position
*/
ns3::Time GetTimeStep();
/**
* \sets the time of the last change in position.
*/
void SetTimeStep();
/**
* \returns the position of Biomarker's Node which is located at the center of the Biomarker.
*/
Vector GetPosition();
/**
* \param posivalue a position Vector.
*
* This function sets the position of Biomarker's Node. Biomarker's position is its Node's position.
* The position Vector must point to the center of the Biomarker.
*/
void SetPosition(Vector posivalue);
/**
* \param device a BiomarkerNetDevice pointer.
*
* This function install the BiomarkerNetDevice inside the Biomarker.
*/
void InstallBiomarkerNetDevice(Ptr<BiomarkerChannel> channel);
/**
* \returns the pointer to the installed Netdevice
*/
Ptr<NetDevice> GetDevice();
/**
* \brief Determines if the biomarker should decay based on its decay rate.
* \return true if the biomarker should decay, false otherwise.
*/
bool ShouldDecay();
/**
* \param decayRate The rate at which the biomarker decays, expressed as a probability per second.
*
* Sets the decay rate of the biomarker.
*/
void SetDecayRate(double decayRate);
/**
* \brief Gets a pointer to the installed BiomarkerNetDevice.
*
* \return A pointer to the BiomarkerNetDevice object associated with this biomarker.
*/
Ptr<BiomarkerNetDevice> GetBiomarkerNetDevice();
/**
* \returns the node of the Biomarker.
*/
Ptr<Node> GetNode();
/**
* \return The active time of the biomarker.
*/
ns3::Time GetActiveTime();
/**
* \param activeTime The duration the biomarker remains active.
*
* Sets the active time of the biomarker.
*/
void SetActiveTime(Time activeTime);
/**
* \return True if the biomarker should be removed from the simulation.
*
* This function checks if the current simulation time has exceeded the biomarker's
* creation time plus its active time.
*/
bool ShouldBeRemoved();
// Install a mobility model for the biomarker
// void InstallMobilityModel(Ptr<MobilityModel> mobilityModel);
static bool Compare (Ptr<Biomarker> v1, Ptr<Biomarker> v2);
}; // Class End
} // namespace ns3
#endif