00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CJNETWORKDIMENSIONER_H_
00021 #define _CJNETWORKDIMENSIONER_H_ 1
00022
00023 #include "CjNLTopology.hh"
00024 #include "CjMatrix.hh"
00025 #include <string>
00026 #include <boost/random.hpp>
00027 #include "CjNetworkProcess.hh"
00028
00029 namespace jmitie {
00030
00031 struct CjNetworkProcess_ctor_va_t;
00032
00034
00036 struct CjNetworkDimensioner_ctor_va_t {
00038 bool m_redim;
00040 const CjNLTopology * m_top;
00042 boost::mt19937 * m_rng;
00044 std::string m_parent_name;
00045
00046 CjNetworkDimensioner_ctor_va_t( CjNLTopology * top, boost::mt19937 * rng, bool redim, std::string parent_name ):m_redim(redim),m_top(top),m_rng(rng),m_parent_name(parent_name) {}
00047 CjNetworkDimensioner_ctor_va_t( const CjNetworkProcess_ctor_va_t & temp, bool redim, std::string parent_name ):m_redim(redim),m_top(temp.m_top),m_rng(temp.m_rng),m_parent_name(parent_name) {}
00048 };
00049
00051
00053 struct CjNetworkDimensioner_calcw_va_t {
00055 int m_epoch;
00057 boost::mt19937 * const m_rng;
00058
00059 CjNetworkDimensioner_calcw_va_t( boost::mt19937 * rng, int epoch ): \
00060 m_epoch(epoch),
00061 m_rng(rng) {}
00062 CjNetworkDimensioner_calcw_va_t( const CjNetworkProcess_act_va_t & temp ): \
00063 m_epoch(temp.m_epoch),
00064 m_rng(temp.m_rng) {}
00065
00066 };
00067
00076 class CjNetworkDimensioner {
00077 public:
00078 typedef CjNetworkDimensioner_ctor_va_t ctor_va_t;
00079 typedef CjNetworkDimensioner_calcw_va_t calcw_va_t;
00080
00082 CjNetworkDimensioner(const ctor_va_t & va):m_redim(va.m_redim),m_top(va.m_top),m_parent_name(va.m_parent_name) {}
00083
00085 virtual CjNLTopology::WT calcWeight( calcw_va_t & va, unsigned int node_from, unsigned int node_to) = 0;
00086
00088 static std::string getName_static() { throw std::logic_error("CjNetworkDimensioner::getName_static() called."); }
00090 static std::string getProperty_static(const std::string &) { throw std::logic_error("CjNetworkDimensioner::getProperty_static(..) called."); }
00092 virtual std::string getName() const = 0;
00094 virtual std::string getProperty(const std::string &) const = 0;
00095
00096 virtual ~CjNetworkDimensioner() { };
00097
00098 protected:
00100 bool m_redim;
00102 const CjNLTopology * m_top;
00103
00104 std::string m_parent_name;
00105
00106 };
00107
00108 }
00109
00110 #endif // _CJNETWORKDIMENSIONER_H_