00001 #ifndef BREAKPOINTPATHLOSSMODEL_H_
00002 #define BREAKPOINTPATHLOSSMODEL_H_
00003
00004 #include "AnalogueModel.h"
00005 #include "Mapping.h"
00006 #include "BaseWorldUtility.h"
00007
00008 #include <cstdlib>
00009
00010
00011
00018 class BreakpointPathlossModel : public AnalogueModel
00019 {
00020 protected:
00021
00022
00023
00024
00025
00026
00027
00029 double PL01, PL02;
00031 double PL01_real, PL02_real;
00032
00034 double alpha1, alpha2;
00035
00037 double breakpointDistance;
00038
00040 double carrierFrequency;
00041
00043 const Move& myMove;
00044
00046 const bool useTorus;
00047
00049 const Coord& playgroundSize;
00050
00052 bool debug;
00053
00055 cOutVector pathlosses;
00056
00057 public:
00073 BreakpointPathlossModel(double L01, double L02, double alpha1, double alpha2, double breakpointDistance,
00074 double carrierFrequency, const Move* myMove,
00075 bool useTorus, const Coord& playgroundSize, bool debug):
00076
00077
00078
00079 PL01(L01), PL02(L02), alpha1(alpha1), alpha2(alpha2), breakpointDistance(breakpointDistance),
00080 carrierFrequency(carrierFrequency),
00081 myMove(*myMove),
00082 useTorus(useTorus),
00083 playgroundSize(playgroundSize),
00084 debug(debug)
00085 {
00086 PL01_real = pow(10, PL01/10);
00087 PL02_real = pow(10, PL02/10);
00088 pathlosses.setName("pathlosses");
00089 }
00090
00095 virtual void filterSignal(Signal& s);
00096
00097 virtual bool isActiveAtDestination() { return true; }
00098
00099 virtual bool isActiveAtOrigin() { return false; }
00100
00101 };
00102
00103 #endif