diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-12-04 13:16:26 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-12-04 13:16:26 +0000 |
commit | c9ff33b9a7421d4f6659722a077c00399c68c2e3 (patch) | |
tree | 607a93ced0e5f19f88de293e1857778fecb51860 /src/ats | |
parent | 9e249590e5d750c70ec61d1100c70d325374dbd8 (diff) | |
download | gnunet-c9ff33b9a7421d4f6659722a077c00399c68c2e3.tar.gz gnunet-c9ff33b9a7421d4f6659722a077c00399c68c2e3.zip |
changes
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/ats.conf.in | 5 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 77 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.h | 22 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.c | 34 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.h | 10 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_simplistic.c | 14 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_simplistic.h | 11 | ||||
-rw-r--r-- | src/ats/perf_ats_mlp.c | 2 | ||||
-rw-r--r-- | src/ats/test_ats_mlp.c | 2 | ||||
-rw-r--r-- | src/ats/test_ats_mlp_averaging.c | 2 |
10 files changed, 129 insertions, 50 deletions
diff --git a/src/ats/ats.conf.in b/src/ats/ats.conf.in index d063af333..9c43d9428 100644 --- a/src/ats/ats.conf.in +++ b/src/ats/ats.conf.in | |||
@@ -30,6 +30,11 @@ WLAN_QUOTA_OUT = 1 MiB | |||
30 | 30 | ||
31 | 31 | ||
32 | # MLP specific settings | 32 | # MLP specific settings |
33 | # MAX_DURATION = 3 s | ||
34 | # MAX_ITERATIONS = 1024 | ||
35 | |||
36 | |||
37 | |||
33 | DUMP_MLP = NO | 38 | DUMP_MLP = NO |
34 | DUMP_SOLUTION = NO | 39 | DUMP_SOLUTION = NO |
35 | DUMP_OVERWRITE = NO | 40 | DUMP_OVERWRITE = NO |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 1a511eb3d..586bed79d 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -64,8 +64,6 @@ enum ATS_Mode | |||
64 | 64 | ||
65 | static struct GNUNET_CONTAINER_MultiHashMap *addresses; | 65 | static struct GNUNET_CONTAINER_MultiHashMap *addresses; |
66 | 66 | ||
67 | static void *solver; | ||
68 | |||
69 | static unsigned long long wan_quota_in; | 67 | static unsigned long long wan_quota_in; |
70 | 68 | ||
71 | static unsigned long long wan_quota_out; | 69 | static unsigned long long wan_quota_out; |
@@ -76,6 +74,21 @@ static int ats_mode; | |||
76 | 74 | ||
77 | static int running; | 75 | static int running; |
78 | 76 | ||
77 | void *solver; | ||
78 | |||
79 | struct GAS_Addresses_Handle | ||
80 | { | ||
81 | int ats_mode; | ||
82 | /* Solver handle */ | ||
83 | void *solver; | ||
84 | |||
85 | /* Solver functions */ | ||
86 | GAS_solver_init s_init; | ||
87 | GAS_solver_done s_done; | ||
88 | GAS_solver_address_delete s_del; | ||
89 | GAS_solver_address_change_preference s_pref; | ||
90 | }; | ||
91 | |||
79 | 92 | ||
80 | static unsigned int | 93 | static unsigned int |
81 | assemble_ats_information (struct ATS_Address *aa, struct GNUNET_ATS_Information **dest) | 94 | assemble_ats_information (struct ATS_Address *aa, struct GNUNET_ATS_Information **dest) |
@@ -991,10 +1004,11 @@ GAS_addresses_change_preference (const struct GNUNET_PeerIdentity *peer, | |||
991 | * @param cfg configuration to use | 1004 | * @param cfg configuration to use |
992 | * @param stats the statistics handle to use | 1005 | * @param stats the statistics handle to use |
993 | */ | 1006 | */ |
994 | void | 1007 | struct GAS_Addresses_Handle * |
995 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 1008 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
996 | const struct GNUNET_STATISTICS_Handle *stats) | 1009 | const struct GNUNET_STATISTICS_Handle *stats) |
997 | { | 1010 | { |
1011 | struct GAS_Addresses_Handle *ah; | ||
998 | int c; | 1012 | int c; |
999 | char *quota_wan_in_str; | 1013 | char *quota_wan_in_str; |
1000 | char *quota_wan_out_str; | 1014 | char *quota_wan_out_str; |
@@ -1063,41 +1077,56 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1063 | } | 1077 | } |
1064 | } | 1078 | } |
1065 | 1079 | ||
1080 | |||
1081 | ah = GNUNET_malloc (sizeof (struct GAS_Addresses_Handle)); | ||
1082 | |||
1066 | /* Start configured solution method */ | 1083 | /* Start configured solution method */ |
1067 | switch (ats_mode) | 1084 | switch (ats_mode) |
1068 | { | 1085 | { |
1069 | case MODE_MLP: | 1086 | case MODE_MLP: |
1070 | /* Init the MLP solver with default values */ | 1087 | /* Init the MLP solver with default values */ |
1071 | solver = GAS_mlp_init (cfg, stats, MLP_MAX_EXEC_DURATION, MLP_MAX_ITERATIONS); | 1088 | #if HAVE_LIBGLPK |
1072 | if (NULL != solver) | 1089 | ah->ats_mode = MODE_MLP; |
1073 | { | 1090 | ah->s_init = &GAS_mlp_init; |
1074 | ats_mode = MODE_MLP; | 1091 | ah->s_pref = &GAS_mlp_address_change_preference; |
1075 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ATS started in %s mode\n", "MLP"); | 1092 | ah->s_del = &GAS_mlp_address_delete; |
1076 | break; | 1093 | ah->s_done = &GAS_mlp_done; |
1077 | } | 1094 | #else |
1078 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize MLP solver!\n"); | 1095 | GNUNET_freee (ah); |
1096 | return NULL; | ||
1097 | #endif | ||
1098 | break; | ||
1079 | case MODE_SIMPLISTIC: | 1099 | case MODE_SIMPLISTIC: |
1080 | /* Init the simplistic solver with default values */ | 1100 | /* Init the simplistic solver with default values */ |
1101 | ah->ats_mode = MODE_SIMPLISTIC; | ||
1102 | ah->s_init = &GAS_simplistic_init; | ||
1103 | ah->s_pref = &GAS_simplistic_address_change_preference; | ||
1104 | ah->s_del = &GAS_simplistic_address_delete; | ||
1105 | ah->s_done = &GAS_simplistic_done; | ||
1081 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ATS started in %s mode\n", "SIMPLISTIC"); | 1106 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ATS started in %s mode\n", "SIMPLISTIC"); |
1082 | solver = GAS_simplistic_init (cfg, stats); | ||
1083 | if (NULL != solver) | ||
1084 | { | ||
1085 | ats_mode = MODE_SIMPLISTIC; | ||
1086 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ATS started in %s mode\n", "SIMPLISTIC"); | ||
1087 | break; | ||
1088 | } | ||
1089 | else | ||
1090 | { | ||
1091 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize simplistic solver!\n"); | ||
1092 | return; | ||
1093 | } | ||
1094 | break; | 1107 | break; |
1095 | default: | 1108 | default: |
1096 | GNUNET_break (0); | 1109 | return NULL; |
1097 | break; | 1110 | break; |
1098 | } | 1111 | } |
1112 | |||
1113 | GNUNET_assert (NULL != ah->s_init); | ||
1114 | GNUNET_assert (NULL != ah->s_pref); | ||
1115 | GNUNET_assert (NULL != ah->s_del); | ||
1116 | GNUNET_assert (NULL != ah->s_done); | ||
1117 | |||
1118 | ah->solver = ah->s_init (cfg, stats); | ||
1119 | /* REMOVE */ solver = ah->solver; | ||
1120 | if (NULL == ah->solver) | ||
1121 | { | ||
1122 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to initialize MLP solver!\n"); | ||
1123 | GNUNET_free (ah); | ||
1124 | return NULL; | ||
1125 | } | ||
1126 | |||
1099 | /* up and running */ | 1127 | /* up and running */ |
1100 | running = GNUNET_YES; | 1128 | running = GNUNET_YES; |
1129 | return ah; | ||
1101 | } | 1130 | } |
1102 | 1131 | ||
1103 | 1132 | ||
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h index a570ba66c..54fb7b7cb 100644 --- a/src/ats/gnunet-service-ats_addresses.h +++ b/src/ats/gnunet-service-ats_addresses.h | |||
@@ -95,17 +95,35 @@ struct ATS_Address | |||
95 | int used; | 95 | int used; |
96 | }; | 96 | }; |
97 | 97 | ||
98 | typedef void | ||
99 | (*GAS_solver_address_change_preference) (void *solver, | ||
100 | const struct GNUNET_PeerIdentity *peer, | ||
101 | enum GNUNET_ATS_PreferenceKind kind, | ||
102 | float score); | ||
103 | |||
104 | typedef void | ||
105 | (*GAS_solver_address_delete) (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); | ||
106 | |||
107 | |||
108 | typedef void * | ||
109 | (*GAS_solver_init) (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
110 | const struct GNUNET_STATISTICS_Handle *stats); | ||
111 | |||
112 | |||
113 | typedef void | ||
114 | (*GAS_solver_done) (void *solver); | ||
115 | |||
116 | |||
98 | /** | 117 | /** |
99 | * Initialize address subsystem. | 118 | * Initialize address subsystem. |
100 | * | 119 | * |
101 | * @param cfg configuration to use | 120 | * @param cfg configuration to use |
102 | * @param stats the statistics handle to use | 121 | * @param stats the statistics handle to use |
103 | */ | 122 | */ |
104 | void | 123 | struct GAS_Addresses_Handle * |
105 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 124 | GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
106 | const struct GNUNET_STATISTICS_Handle *stats); | 125 | const struct GNUNET_STATISTICS_Handle *stats); |
107 | 126 | ||
108 | |||
109 | /** | 127 | /** |
110 | * Shutdown address subsystem. | 128 | * Shutdown address subsystem. |
111 | */ | 129 | */ |
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.c b/src/ats/gnunet-service-ats_addresses_mlp.c index b3c1512ce..0edf6eed1 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.c +++ b/src/ats/gnunet-service-ats_addresses_mlp.c | |||
@@ -1073,11 +1073,9 @@ GAS_mlp_solve_problem (struct GAS_MLP_Handle *mlp, struct GAS_MLP_SolutionContex | |||
1073 | * @param max_iterations maximum time limit for the LP/MLP Solver | 1073 | * @param max_iterations maximum time limit for the LP/MLP Solver |
1074 | * @return struct GAS_MLP_Handle * on success, NULL on fail | 1074 | * @return struct GAS_MLP_Handle * on success, NULL on fail |
1075 | */ | 1075 | */ |
1076 | struct GAS_MLP_Handle * | 1076 | void * |
1077 | GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 1077 | GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1078 | const struct GNUNET_STATISTICS_Handle *stats, | 1078 | const struct GNUNET_STATISTICS_Handle *stats) |
1079 | struct GNUNET_TIME_Relative max_duration, | ||
1080 | unsigned int max_iterations) | ||
1081 | { | 1079 | { |
1082 | struct GAS_MLP_Handle * mlp = GNUNET_malloc (sizeof (struct GAS_MLP_Handle)); | 1080 | struct GAS_MLP_Handle * mlp = GNUNET_malloc (sizeof (struct GAS_MLP_Handle)); |
1083 | 1081 | ||
@@ -1092,6 +1090,9 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1092 | char * quota_out_str; | 1090 | char * quota_out_str; |
1093 | char * quota_in_str; | 1091 | char * quota_in_str; |
1094 | 1092 | ||
1093 | struct GNUNET_TIME_Relative max_duration; | ||
1094 | long long unsigned int max_iterations; | ||
1095 | |||
1095 | /* Init GLPK environment */ | 1096 | /* Init GLPK environment */ |
1096 | int res = glp_init_env(); | 1097 | int res = glp_init_env(); |
1097 | switch (res) { | 1098 | switch (res) { |
@@ -1125,6 +1126,21 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1125 | 1126 | ||
1126 | mlp->BIG_M = (double) BIG_M_VALUE; | 1127 | mlp->BIG_M = (double) BIG_M_VALUE; |
1127 | 1128 | ||
1129 | /* Get maximum number of iterations */ | ||
1130 | |||
1131 | |||
1132 | /* Get timeout for iterations */ | ||
1133 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time(cfg, "ats", "MAX_DURATION", &max_duration)) | ||
1134 | { | ||
1135 | max_duration = MLP_MAX_EXEC_DURATION; | ||
1136 | } | ||
1137 | |||
1138 | |||
1139 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_size(cfg, "ats", "MAX_ITERATIONS", &max_iterations)) | ||
1140 | { | ||
1141 | max_iterations = MLP_MAX_ITERATIONS; | ||
1142 | } | ||
1143 | |||
1128 | /* Get diversity coefficient from configuration */ | 1144 | /* Get diversity coefficient from configuration */ |
1129 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats", | 1145 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats", |
1130 | "COEFFICIENT_D", | 1146 | "COEFFICIENT_D", |
@@ -1614,8 +1630,9 @@ GAS_mlp_address_update (struct GAS_MLP_Handle *mlp, struct GNUNET_CONTAINER_Mult | |||
1614 | * @param address the address to delete | 1630 | * @param address the address to delete |
1615 | */ | 1631 | */ |
1616 | void | 1632 | void |
1617 | GAS_mlp_address_delete (struct GAS_MLP_Handle *mlp, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address) | 1633 | GAS_mlp_address_delete (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address) |
1618 | { | 1634 | { |
1635 | struct GAS_MLP_Handle *mlp = solver; | ||
1619 | GNUNET_STATISTICS_update (mlp->stats,"# LP address deletions", 1, GNUNET_NO); | 1636 | GNUNET_STATISTICS_update (mlp->stats,"# LP address deletions", 1, GNUNET_NO); |
1620 | struct GAS_MLP_SolutionContext ctx; | 1637 | struct GAS_MLP_SolutionContext ctx; |
1621 | 1638 | ||
@@ -1718,16 +1735,18 @@ GAS_mlp_get_preferred_address (struct GAS_MLP_Handle *mlp, | |||
1718 | * @param score the score | 1735 | * @param score the score |
1719 | */ | 1736 | */ |
1720 | void | 1737 | void |
1721 | GAS_mlp_address_change_preference (struct GAS_MLP_Handle *mlp, | 1738 | GAS_mlp_address_change_preference (void *solver, |
1722 | const struct GNUNET_PeerIdentity *peer, | 1739 | const struct GNUNET_PeerIdentity *peer, |
1723 | enum GNUNET_ATS_PreferenceKind kind, | 1740 | enum GNUNET_ATS_PreferenceKind kind, |
1724 | float score) | 1741 | float score) |
1725 | { | 1742 | { |
1743 | struct GAS_MLP_Handle *mlp = solver; | ||
1726 | GNUNET_STATISTICS_update (mlp->stats,"# LP address preference changes", 1, GNUNET_NO); | 1744 | GNUNET_STATISTICS_update (mlp->stats,"# LP address preference changes", 1, GNUNET_NO); |
1727 | 1745 | ||
1728 | //struct ATS_Peer *p = mlp_find_peer (mlp, peer); | 1746 | //struct ATS_Peer *p = mlp_find_peer (mlp, peer); |
1729 | //FIXME to finish implementation | 1747 | //FIXME to finish implementation |
1730 | /* Here we have to do the matching */ | 1748 | /* Here we have to do the matching */ |
1749 | |||
1731 | } | 1750 | } |
1732 | 1751 | ||
1733 | /** | 1752 | /** |
@@ -1735,8 +1754,9 @@ GAS_mlp_address_change_preference (struct GAS_MLP_Handle *mlp, | |||
1735 | * @param mlp the MLP handle | 1754 | * @param mlp the MLP handle |
1736 | */ | 1755 | */ |
1737 | void | 1756 | void |
1738 | GAS_mlp_done (struct GAS_MLP_Handle *mlp) | 1757 | GAS_mlp_done (void *solver) |
1739 | { | 1758 | { |
1759 | struct GAS_MLP_Handle *mlp = solver; | ||
1740 | struct ATS_Peer * peer; | 1760 | struct ATS_Peer * peer; |
1741 | struct ATS_Address *addr; | 1761 | struct ATS_Address *addr; |
1742 | 1762 | ||
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.h b/src/ats/gnunet-service-ats_addresses_mlp.h index d37eea752..af3625c8d 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.h +++ b/src/ats/gnunet-service-ats_addresses_mlp.h | |||
@@ -321,11 +321,9 @@ struct MLP_information | |||
321 | * @param max_iterations maximum time limit for the LP/MLP Solver | 321 | * @param max_iterations maximum time limit for the LP/MLP Solver |
322 | * @return struct GAS_MLP_Handle * on success, NULL on fail | 322 | * @return struct GAS_MLP_Handle * on success, NULL on fail |
323 | */ | 323 | */ |
324 | struct GAS_MLP_Handle * | 324 | void * |
325 | GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 325 | GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
326 | const struct GNUNET_STATISTICS_Handle *stats, | 326 | const struct GNUNET_STATISTICS_Handle *stats); |
327 | struct GNUNET_TIME_Relative max_duration, | ||
328 | unsigned int max_iterations); | ||
329 | 327 | ||
330 | /** | 328 | /** |
331 | * Solves the MLP problem on demand | 329 | * Solves the MLP problem on demand |
@@ -367,7 +365,7 @@ GAS_mlp_address_update (struct GAS_MLP_Handle *mlp, struct GNUNET_CONTAINER_Mult | |||
367 | * @param address the address to delete | 365 | * @param address the address to delete |
368 | */ | 366 | */ |
369 | void | 367 | void |
370 | GAS_mlp_address_delete (struct GAS_MLP_Handle *mlp, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); | 368 | GAS_mlp_address_delete (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); |
371 | 369 | ||
372 | 370 | ||
373 | /** | 371 | /** |
@@ -379,7 +377,7 @@ GAS_mlp_address_delete (struct GAS_MLP_Handle *mlp, struct GNUNET_CONTAINER_Mult | |||
379 | * @param score the score | 377 | * @param score the score |
380 | */ | 378 | */ |
381 | void | 379 | void |
382 | GAS_mlp_address_change_preference (struct GAS_MLP_Handle *mlp, | 380 | GAS_mlp_address_change_preference (void *solver, |
383 | const struct GNUNET_PeerIdentity *peer, | 381 | const struct GNUNET_PeerIdentity *peer, |
384 | enum GNUNET_ATS_PreferenceKind kind, | 382 | enum GNUNET_ATS_PreferenceKind kind, |
385 | float score); | 383 | float score); |
diff --git a/src/ats/gnunet-service-ats_addresses_simplistic.c b/src/ats/gnunet-service-ats_addresses_simplistic.c index be7380692..e942f7abe 100644 --- a/src/ats/gnunet-service-ats_addresses_simplistic.c +++ b/src/ats/gnunet-service-ats_addresses_simplistic.c | |||
@@ -42,7 +42,7 @@ struct GAS_SIMPLISTIC_Handle | |||
42 | * @param stats the GNUNET_STATISTICS handle | 42 | * @param stats the GNUNET_STATISTICS handle |
43 | * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail | 43 | * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail |
44 | */ | 44 | */ |
45 | struct GAS_SIMPLISTIC_Handle * | 45 | void * |
46 | GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 46 | GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
47 | const struct GNUNET_STATISTICS_Handle *stats) | 47 | const struct GNUNET_STATISTICS_Handle *stats) |
48 | { | 48 | { |
@@ -54,7 +54,7 @@ GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
54 | * Shutdown the simplistic problem solving component | 54 | * Shutdown the simplistic problem solving component |
55 | */ | 55 | */ |
56 | void | 56 | void |
57 | GAS_simplistic_done (struct GAS_SIMPLISTIC_Handle *solver) | 57 | GAS_simplistic_done (void *solver) |
58 | { | 58 | { |
59 | GNUNET_free (solver); | 59 | GNUNET_free (solver); |
60 | } | 60 | } |
@@ -68,7 +68,13 @@ GAS_simplistic_done (struct GAS_SIMPLISTIC_Handle *solver) | |||
68 | * @param address the address to update | 68 | * @param address the address to update |
69 | */ | 69 | */ |
70 | void | 70 | void |
71 | GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address) | 71 | GAS_simplistic_address_update (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address) |
72 | { | ||
73 | |||
74 | } | ||
75 | |||
76 | void | ||
77 | GAS_simplistic_address_delete (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address) | ||
72 | { | 78 | { |
73 | 79 | ||
74 | } | 80 | } |
@@ -82,7 +88,7 @@ GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUN | |||
82 | * @param score the score | 88 | * @param score the score |
83 | */ | 89 | */ |
84 | void | 90 | void |
85 | GAS_simplistic_address_change_preference (struct GAS_SIMPLISTIC_Handle *solver, | 91 | GAS_simplistic_address_change_preference (void *solver, |
86 | const struct GNUNET_PeerIdentity *peer, | 92 | const struct GNUNET_PeerIdentity *peer, |
87 | enum GNUNET_ATS_PreferenceKind kind, | 93 | enum GNUNET_ATS_PreferenceKind kind, |
88 | float score) | 94 | float score) |
diff --git a/src/ats/gnunet-service-ats_addresses_simplistic.h b/src/ats/gnunet-service-ats_addresses_simplistic.h index dcaf27b46..f68eff9c1 100644 --- a/src/ats/gnunet-service-ats_addresses_simplistic.h +++ b/src/ats/gnunet-service-ats_addresses_simplistic.h | |||
@@ -37,7 +37,7 @@ struct GAS_SIMPLISTIC_Handle; | |||
37 | * @param stats the GNUNET_STATISTICS handle | 37 | * @param stats the GNUNET_STATISTICS handle |
38 | * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail | 38 | * @return struct GAS_SIMPLISTIC_Handle * on success, NULL on fail |
39 | */ | 39 | */ |
40 | struct GAS_SIMPLISTIC_Handle * | 40 | void * |
41 | GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 41 | GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
42 | const struct GNUNET_STATISTICS_Handle *stats); | 42 | const struct GNUNET_STATISTICS_Handle *stats); |
43 | 43 | ||
@@ -45,7 +45,7 @@ GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
45 | * Shutdown the simplistic problem solving component | 45 | * Shutdown the simplistic problem solving component |
46 | */ | 46 | */ |
47 | void | 47 | void |
48 | GAS_simplistic_done (struct GAS_SIMPLISTIC_Handle *); | 48 | GAS_simplistic_done (void * solver); |
49 | 49 | ||
50 | 50 | ||
51 | /** | 51 | /** |
@@ -57,7 +57,10 @@ GAS_simplistic_done (struct GAS_SIMPLISTIC_Handle *); | |||
57 | * @param address the address to update | 57 | * @param address the address to update |
58 | */ | 58 | */ |
59 | void | 59 | void |
60 | GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); | 60 | GAS_simplistic_address_update (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); |
61 | |||
62 | void | ||
63 | GAS_simplistic_address_delete (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address); | ||
61 | 64 | ||
62 | /** | 65 | /** |
63 | * Changes the preferences for a peer in the problem | 66 | * Changes the preferences for a peer in the problem |
@@ -68,7 +71,7 @@ GAS_simplistic_address_update (struct GAS_SIMPLISTIC_Handle *solver, struct GNUN | |||
68 | * @param score the score | 71 | * @param score the score |
69 | */ | 72 | */ |
70 | void | 73 | void |
71 | GAS_simplistic_address_change_preference (struct GAS_SIMPLISTIC_Handle *solver, | 74 | GAS_simplistic_address_change_preference (void *solver, |
72 | const struct GNUNET_PeerIdentity *peer, | 75 | const struct GNUNET_PeerIdentity *peer, |
73 | enum GNUNET_ATS_PreferenceKind kind, | 76 | enum GNUNET_ATS_PreferenceKind kind, |
74 | float score); | 77 | float score); |
diff --git a/src/ats/perf_ats_mlp.c b/src/ats/perf_ats_mlp.c index 751fad51a..6567e3c01 100644 --- a/src/ats/perf_ats_mlp.c +++ b/src/ats/perf_ats_mlp.c | |||
@@ -195,7 +195,7 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
195 | 195 | ||
196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up %u peers with %u addresses per peer\n", peers, addresses); | 196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up %u peers with %u addresses per peer\n", peers, addresses); |
197 | 197 | ||
198 | mlp = GAS_mlp_init (cfg, NULL, MLP_MAX_EXEC_DURATION, MLP_MAX_ITERATIONS); | 198 | mlp = GAS_mlp_init (cfg, NULL); |
199 | if (NULL == mlp) | 199 | if (NULL == mlp) |
200 | { | 200 | { |
201 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to init MLP\n"); | 201 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to init MLP\n"); |
diff --git a/src/ats/test_ats_mlp.c b/src/ats/test_ats_mlp.c index 3e449dbd2..a0b081360 100644 --- a/src/ats/test_ats_mlp.c +++ b/src/ats/test_ats_mlp.c | |||
@@ -78,7 +78,7 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
78 | 78 | ||
79 | addresses = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); | 79 | addresses = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); |
80 | 80 | ||
81 | mlp = GAS_mlp_init (cfg, NULL, MLP_MAX_EXEC_DURATION, MLP_MAX_ITERATIONS); | 81 | mlp = GAS_mlp_init (cfg, NULL); |
82 | mlp->auto_solve = GNUNET_NO; | 82 | mlp->auto_solve = GNUNET_NO; |
83 | 83 | ||
84 | struct GNUNET_PeerIdentity p[10]; | 84 | struct GNUNET_PeerIdentity p[10]; |
diff --git a/src/ats/test_ats_mlp_averaging.c b/src/ats/test_ats_mlp_averaging.c index 2f70137df..371f9e994 100644 --- a/src/ats/test_ats_mlp_averaging.c +++ b/src/ats/test_ats_mlp_averaging.c | |||
@@ -79,7 +79,7 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
79 | 79 | ||
80 | addresses = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); | 80 | addresses = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); |
81 | 81 | ||
82 | mlp = GAS_mlp_init (cfg, NULL, MLP_MAX_EXEC_DURATION, MLP_MAX_ITERATIONS); | 82 | mlp = GAS_mlp_init (cfg, NULL); |
83 | mlp->auto_solve = GNUNET_NO; | 83 | mlp->auto_solve = GNUNET_NO; |
84 | 84 | ||
85 | struct GNUNET_PeerIdentity p[10]; | 85 | struct GNUNET_PeerIdentity p[10]; |