gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29145 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r29145 - gnunet/src/ats
Date: Tue, 10 Sep 2013 11:14:18 +0200

Author: oehlmann
Date: 2013-09-10 11:14:18 +0200 (Tue, 10 Sep 2013)
New Revision: 29145

Modified:
   gnunet/src/ats/gnunet-service-ats-solver_ril.c
   gnunet/src/ats/gnunet-service-ats-solver_ril.h
   gnunet/src/ats/gnunet-service-ats_addresses.c
Log:
added GAS_ril_addresses_preference_feedback() handle

Modified: gnunet/src/ats/gnunet-service-ats-solver_ril.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_ril.c      2013-09-10 08:54:30 UTC 
(rev 29144)
+++ gnunet/src/ats/gnunet-service-ats-solver_ril.c      2013-09-10 09:14:18 UTC 
(rev 29145)
@@ -413,7 +413,7 @@
        }
        if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size(cfg, "ats", 
"RIL_DISCOUNT_FACTOR", &tmp))
        {
-               solver->parameters.gamma = tmp;
+               solver->parameters.gamma = (double) tmp / 100;;
        }
        else
        {
@@ -421,7 +421,7 @@
        }
        if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size(cfg, "ats", 
"RIL_GRADIENT_STEP_SIZE", &tmp))
        {
-               solver->parameters.alpha = tmp;
+               solver->parameters.alpha = (double) tmp / 100;;
        }
        else
        {
@@ -429,7 +429,7 @@
        }
        if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size(cfg, "ats", 
"RIL_TRACE_DECAY", &tmp))
        {
-               solver->parameters.lambda = tmp;
+               solver->parameters.lambda = (double) tmp / 100;;
        }
        else
        {
@@ -634,6 +634,28 @@
 }
 
 /**
+ * Get application feedback for a peer
+ *
+ * @param solver the solver handle
+ * @param application the application
+ * @param peer the peer to change the preference for
+ * @param scope the time interval for this feedback: [now - scope .. now]
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_ril_address_preference_feedback (void *solver,
+                                                                               
        void *application,
+                                                                               
        const struct GNUNET_PeerIdentity *peer,
+                                                                               
        const struct GNUNET_TIME_Relative scope,
+                                                                               
        enum GNUNET_ATS_PreferenceKind kind,
+                                                                               
        double score)
+{
+       //TODO implement
+       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ril_address_preference_feedback() 
has been called\n");
+}
+
+/**
  * Start a bulk operation
  *
  * @param solver the solver

Modified: gnunet/src/ats/gnunet-service-ats-solver_ril.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats-solver_ril.h      2013-09-10 08:54:30 UTC 
(rev 29144)
+++ gnunet/src/ats/gnunet-service-ats-solver_ril.h      2013-09-10 09:14:18 UTC 
(rev 29145)
@@ -191,6 +191,23 @@
 GAS_ril_address_delete (void *solver,
     struct ATS_Address *address, int session_only);
 
+/**
+ * Get application feedback for a peer
+ *
+ * @param solver the solver handle
+ * @param application the application
+ * @param peer the peer to change the preference for
+ * @param scope the time interval for this feedback: [now - scope .. now]
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_ril_address_preference_feedback (void *solver,
+                                                                               
        void *application,
+                                                                               
        const struct GNUNET_PeerIdentity *peer,
+                                                                               
        const struct GNUNET_TIME_Relative scope,
+                                                                               
        enum GNUNET_ATS_PreferenceKind kind,
+                                                                               
        double score);
 
 /**
  * Start a bulk operation

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2013-09-10 08:54:30 UTC 
(rev 29144)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2013-09-10 09:14:18 UTC 
(rev 29145)
@@ -1694,7 +1694,7 @@
  * Initialize address subsystem. The addresses subsystem manages the addresses
  * known and current performance information. It has a solver component
  * responsible for the resource allocation. It tells the solver about changes
- * and receives updates when the solver changes the ressource allocation.
+ * and receives updates when the solver changes the resource allocation.
  *
  * @param cfg configuration to use
  * @param stats the statistics handle to use
@@ -1809,6 +1809,7 @@
          ah->s_get = &GAS_ril_get_preferred_address;
          ah->s_get_stop = &GAS_ril_stop_get_preferred_address;
          ah->s_pref = &GAS_ril_address_change_preference;
+         ah->s_feedback = &GAS_ril_address_preference_feedback;
          ah->s_del  = &GAS_ril_address_delete;
          ah->s_bulk_start = &GAS_ril_bulk_start;
          ah->s_bulk_stop = &GAS_ril_bulk_stop;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]