changes
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 3 Dec 2012 15:05:57 +0000 (15:05 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 3 Dec 2012 15:05:57 +0000 (15:05 +0000)
src/ats/gnunet-service-ats_addresses.c
src/ats/gnunet-service-ats_addresses_simplistic.c
src/ats/gnunet-service-ats_addresses_simplistic.h

index 47ba3312b3de8ac7aea8f6e282ac05b16406560f..1a511eb3d85b9dbe3eb6a36157271324676d4358 100644 (file)
@@ -564,6 +564,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
       break;
     }
 
+  /* Tell solver about update */
   switch (ats_mode)
   {
     case MODE_MLP:
@@ -812,10 +813,20 @@ GAS_addresses_in_use (const struct GNUNET_PeerIdentity *peer,
     return GNUNET_SYSERR;
   }
   old->used = in_use;
-#if HAVE_LIBGLPK
-  if (ats_mode == MODE_MLP)
-     GAS_mlp_address_update (solver, addresses, old);
-#endif
+
+  /* Tell solver about update */
+  switch (ats_mode)
+  {
+    case MODE_MLP:
+      GAS_mlp_address_update (solver, addresses, old);
+      break;
+    case MODE_SIMPLISTIC:
+      GAS_simplistic_address_update (solver, addresses, old);
+      break;
+    default:
+      GNUNET_break (0);
+      break;
+  }
   return GNUNET_OK;
 }
 
@@ -955,10 +966,21 @@ GAS_addresses_change_preference (const struct GNUNET_PeerIdentity *peer,
 {
   if (GNUNET_NO == running)
     return;
-#if HAVE_LIBGLPK
-  if (ats_mode == MODE_MLP)
-    GAS_mlp_address_change_preference (solver, peer, kind, score);
-#endif
+
+
+  /* Tell solver about update */
+  switch (ats_mode)
+  {
+    case MODE_MLP:
+      GAS_mlp_address_change_preference (solver, peer, kind, score);
+      break;
+    case MODE_SIMPLISTIC:
+      GAS_simplistic_address_change_preference (solver, peer, kind, score);
+      break;
+    default:
+      GNUNET_break (0);
+      break;
+  }
 }
 
 
index dca97f401c2814b9f9d5bc0899e222ec22d7fa13..359a683aa4122f3aa28445c6f886599c4f75e10f 100644 (file)
@@ -75,4 +75,21 @@ GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUN
 
 }
 
+/**
+ * Changes the preferences for a peer in the  problem
+ *
+ * @param solver the solver handle
+ * @param peer the peer
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_simplistic_address_change_preference (struct GAS_SIMPLISTIC_Handle *solver,
+                                   const struct GNUNET_PeerIdentity *peer,
+                                   enum GNUNET_ATS_PreferenceKind kind,
+                                   float score)
+{
+
+}
+
 /* end of gnunet-service-ats_addresses_simplistic.c */
index 2e1e149117e935206eee99e3dd02491c3a021227..be4e98a45a28c24904091aef68337a52d2202721 100644 (file)
@@ -61,4 +61,19 @@ GAS_simplistic_done (struct GAS_SIMPLISTIC_Handle *);
 void
 GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address);
 
+/**
+ * Changes the preferences for a peer in the  problem
+ *
+ * @param solver the solver handle
+ * @param peer the peer
+ * @param kind the kind to change the preference
+ * @param score the score
+ */
+void
+GAS_simplistic_address_change_preference (struct GAS_SIMPLISTIC_Handle *solver,
+                                   const struct GNUNET_PeerIdentity *peer,
+                                   enum GNUNET_ATS_PreferenceKind kind,
+                                   float score);
+
+
 /* end of gnunet-service-ats_addresses_simplistic.h */