00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef MFULLPROPAGATION_H
00031 #define MFULLPROPAGATION_H
00032
00033
00034 #include<tclcl.h>
00035 #include<timer-handler.h>
00036 #include"mpropagation.h"
00037
00038
00039 class MFullPropagation;
00044 class SampleTimer : public TimerHandler
00045 {
00046 public:
00047 SampleTimer(MFullPropagation *m) : TimerHandler() { module = m; }
00048
00049 protected:
00050 virtual void expire(Event *e);
00051 MFullPropagation* module;
00052 };
00053
00054
00055
00056 class Packet;
00057 class Position;
00058
00059
00070 class MFullPropagation : public MPropagation
00071 {
00072 friend class SampleTimer;
00073 public:
00074 MFullPropagation();
00079 virtual double getGain(Packet* p);
00080 virtual int command(int argc, const char*const* argv);
00081
00082 protected:
00087 double Gaussian();
00098 void initialize_common(unsigned long int N0, double d, double **amp, double *incr);
00106 void initialize_phases(unsigned long int N0, double *phases);
00114 void initialize_all_phases(unsigned long int N0,double ****phases);
00126 void oscillators(unsigned long int N0,double *phases,double *incr, double **amp,double *x);
00131 void FadingInit();
00136 void ShadowInit();
00141 void Init();
00149 double Shadowing(Position* node1, Position* node2);
00158 double Rayleigh(int txId, int rxId);
00165 double PathLoss(double distance, double lambda);
00172 int getSimulatedNodeId(Position* p);
00185 void compute_fading(unsigned long int N0,double ****phases,double *incr, double **amp,double **fad,double ***A2);
00191 void simulationStep();
00192
00193 double** amp_;
00194 double* incr_;
00195 double**** phases_;
00196 double** fad_;
00197 double maxDopplerShift_;
00198 double d_;
00199 double*** A2_;
00200 unsigned int nRays_;
00201 int N0_;
00202 double refDistance_;
00203
00204 double beta_;
00205
00206
00207
00208
00209
00210
00211
00212
00213 SampleTimer sampleTimer_;
00214 double timeUnit_;
00215
00216
00217 int rayleighFading_;
00218 double xFieldWidth_;
00219 double yFieldWidth_;
00220 double* shadowMat_;
00221
00222
00223
00224
00225 double shadowSigma_;
00226 int nodesNum_;
00227
00228 Position** nodesIndexArray_;
00229
00230 int debug_;
00231 };
00232
00233 #endif