00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef DDF_SENSORNODECSTSPEED_HPP
00013 #define DDF_SENSORNODECSTSPEED_HPP
00014
00015 #include "upd_const_speed.hpp"
00016 #include "ddf/sensornodeipc.hpp"
00017 #include "ddf/ipcproccomm.hpp"
00018 #include "ddf/commfactory.hpp"
00019 #include "ddf/predictmodelfactory.hpp"
00020
00021 namespace jafar
00022 {
00023 namespace ddfsimu
00024 {
00025
00030 typedef Upd_const_speed CSNode_PredMod;
00031
00032 class CstSpeedPredictModelFactory : public PredictModelFactoryBase
00033 {
00034 unsigned short m_dim;
00035 unsigned short m_sv_size;
00036 unsigned short m_q_size;
00037 VEC m_q;
00038
00039 public:
00040 CstSpeedPredictModelFactory(unsigned short dim, unsigned short sv_size, unsigned short q_size):
00041 m_dim(dim), m_sv_size(sv_size), m_q_size(q_size), m_q(q_size)
00042 {
00043 const double var = TWOSIGMA_TO_VAR(5e-4);
00044 for(int i = 0; i < q_size; i++) m_q[i] = var;
00045 }
00046
00047 CstSpeedPredictModelFactory(unsigned short dim, unsigned short sv_size, unsigned short q_size, VEC const& var):
00048 m_dim(dim), m_sv_size(sv_size), m_q_size(q_size), m_q(q_size)
00049 { JFR_PRECOND(var.size() == q_size, "bad sizes"); for(int i = 0; i < q_size; i++) m_q[i] = var[i]; }
00050
00051
00052 virtual ~CstSpeedPredictModelFactory() {}
00053
00054 PredictionEngineBase* CreatePredictionModel() { return new CSNode_PredMod(m_dim,m_sv_size,m_q_size,m_q); }
00055 };
00056
00057 typedef ParametersGeneric CSNode_Params;
00058 typedef CommFactoryGeneric<IPCProcComm> CSNode_CommFactory;
00059 typedef CstSpeedPredictModelFactory CSNode_PredModFactory;
00060 typedef ChannelFilterBase CSNode_ChanFilter;
00061 typedef SensorNodeIPC<CSNode_Params> CSNode;
00062
00063 }
00064 }
00065 #endif