00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CJND_NROUTES_H_
00021 #define __CJND_NROUTES_H_ 1
00022
00023 #include "CjNLTopology.hh"
00024 #include "CjNetworkDimensioner.hh"
00025 #include <string>
00026 #include <stdexcept>
00027
00028 namespace jmitie {
00029 namespace corelib {
00030 class CjND_nroutes : public CjNetworkDimensioner {
00031
00032 protected:
00033 CjNLTopology::WT m_minimumValue;
00034 double m_alpha;
00035 bool m_alpha_set;
00036 double m_beta;
00037 bool m_beta_set;
00038 bool m_warn;
00039 bool m_redim;
00040
00041 public:
00042 static std::string getName_static() { return "nroutes"; }
00043 std::string getName() const { return getName_static(); };
00044 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00045 static std::string getProperty_static(const std::string & opt) {
00046 if(opt=="desc") return "Sets the link to a function of the number of routes (routes, not load) that traverse it.";
00047 if(opt=="usage") return getProperty_static("desc") + "\nSets the weight of the link to alpha*number_of_routes_on_link^beta. If alpha or beta are not specified then their value defaults to 1.0. min_val is the minimum value a link weight could be.\n"\
00048 "[alpha=float]\tThe optional co-efficient of the number of routes. This value must be positive.\n"\
00049 "[beta=float]\tThe optional exponent of the link weight when using pref selection.\n"\
00050 "min_val=integer\tThe minimum link weight that will be returned. This value will be returned if the dimensioning is for a new link (therefore no routes to count). This can be any integer greater than 0.\n"\
00051 "[no_warn]\tPrevents the printing of a warning message every time the minimum value is used.";
00052 throw std::invalid_argument("CjND_nroutes::getProperty_static(" + opt + "): Unknown property requested.");
00053 }
00054
00055 CjND_nroutes( const std::string & arg, const ctor_va_t & );
00056 virtual CjNLTopology::WT calcWeight( calcw_va_t & va, unsigned int, unsigned int );
00057
00058 };
00059 }
00060 }
00061
00062 #endif // __CJND_NROUTES_H_