00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _CJNS_EP_
00021 #define _CJNS_EP_ 1
00022
00023 #include "CjNodeSelector.hh"
00024 #include <string>
00025 #include "JLOG.hh"
00026
00027 namespace jmitie {
00028 namespace corelib {
00029 class CjNS_EP: public CjNodeSelector {
00030 public:
00031 static std::string getName_static() { return "EP"; }
00032 virtual std::string getName() const { return getName_static(); }
00033 std::string getProperty(const std::string & prop) const { return getProperty_static(prop); }
00034 static std::string getProperty_static(const std::string & opt) {
00035 if(opt=="desc") return "Selects a second node preferring those with a higher value of alpha*geographic_distance_between_nodes_in_pair^beta.";
00036 if(opt=="usage") return getProperty_static("desc") + "\n" \
00037 "alpha=float\tSpecifies the value to use for the distance co-efficient.\n" \
00038 "beta=float\tSpecifies the value to use for the distance exponent.\n" \
00039 "[no_warn]\tDisables the warning about values of alpha and beta outside of expected bounds.\n"\
00040 "[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";
00041 throw std::invalid_argument("CjNS_EP::getProperty_static(" + opt + "): Unknown property requested.");
00042 }
00043
00044
00045 CjNS_EP(std::string args, const ctor_va_t &);
00046 virtual bool selectNode( select_arg_t &, unsigned int & node );
00047 virtual ~CjNS_EP() { JLOG(5, std::cout << "CjNS_EP being destroyed." << std::endl; ) };
00048
00049 protected:
00050 bool m_dupe_link_ok;
00051 bool m_no_alpha_beta_warn;
00052 double m_alpha;
00053 double m_beta;
00054
00055 };
00056 }
00057 }
00058
00059 #endif // _CJNS_EP_