00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 TODO !!!!!!!!!!!!!!!!!!!11
00021
00022
00023 #ifndef _CJNS_RPN_
00024 #define _CJNS_RPN_ 1
00025
00026 #include "CjNodeSelector.hh"
00027 #include <string>
00028 #include "JLOG.hh"
00029
00030 class CjNS_RPN: public CjNodeSelector {
00031 public:
00032 static std::string getName_static() { return "RPN"; }
00033 virtual std::string getName() const { return getName_static(); };
00034 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00035 static std::string getProperty_static(const std::string & opt) {
00036 if(opt=="desc") return "Select a node based on the number of routes entering, exiting or the sum of entering and exiting a node.";
00037 if(opt=="usage") return getProperty_static("desc") + "\n" \
00038 "(in|out|both)\tSpecify whether to consider incoming, outgoing or both kind of routes."\
00039 "[ave]\tSpecifies whether the sum of routes from all links is to be divided by the number of in- or out- or sum of in- out- degree.\n"\
00040 "[exp=float]\tIf specified the [average] number of routes is taken to this exponent before being placed in selection wheel.\n"\
00041 "[dupe_ok]\tIf specified, and if this is the second selector in a process, the selector may return a node which is already connected to this node.\n";
00042 throw std::invalid_argument("CjNS_RPN::getProperty_static(" + opt + "): Unknown property requested.");
00043 }
00044
00045 CjNS_RPN(std::string args, const ctor_va_t &);
00046
00047 virtual unsigned int selectNode( select_arg_t & );
00048 virtual ~CjNS_RPN() { JLOG(5, std::cout << "CjNS_RPN being destroyed." << std::endl; ) };
00049
00050 protected:
00051 enum sel_t { NOTSET = 0, IN, OUT, BOTH };
00052 sel_t m_selecta;
00053 bool m_average;
00054 bool m_dupe_link_ok;
00055 double m_exp;
00056 bool m_exp_set;
00057
00058 };
00059
00060 #endif // _CJNS_RPN_