diff options
author | Fabian Oehlmann <oehlmann@in.tum.de> | 2014-02-12 11:08:44 +0000 |
---|---|---|
committer | Fabian Oehlmann <oehlmann@in.tum.de> | 2014-02-12 11:08:44 +0000 |
commit | 908cca82ad1dcd1c5bea62cfb8526e66a1226540 (patch) | |
tree | 4e46069bd17b6274ae68c66ef0792bd4ac7f3a97 /src | |
parent | a9b8018749f3e27cdf7dbbaf8d63b65fb4edea5c (diff) | |
download | gnunet-908cca82ad1dcd1c5bea62cfb8526e66a1226540.tar.gz gnunet-908cca82ad1dcd1c5bea62cfb8526e66a1226540.zip |
- better variable names
- fast start
- utilization in utility
Diffstat (limited to 'src')
-rwxr-xr-x | src/ats/plugin_ats_ril.c | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c index c0fc40a0f..44eff203d 100755 --- a/src/ats/plugin_ats_ril.c +++ b/src/ats/plugin_ats_ril.c | |||
@@ -37,18 +37,18 @@ | |||
37 | 37 | ||
38 | #define RIL_DEFAULT_STEP_TIME_MIN GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 300) | 38 | #define RIL_DEFAULT_STEP_TIME_MIN GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 300) |
39 | #define RIL_DEFAULT_STEP_TIME_MAX GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 2000) | 39 | #define RIL_DEFAULT_STEP_TIME_MAX GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 2000) |
40 | #define RIL_DEFAULT_ALGORITHM RIL_ALGO_Q | 40 | #define RIL_DEFAULT_ALGORITHM RIL_ALGO_SARSA |
41 | #define RIL_DEFAULT_SELECT RIL_SELECT_EGREEDY | 41 | #define RIL_DEFAULT_SELECT RIL_SELECT_SOFTMAX |
42 | #define RIL_DEFAULT_WELFARE RIL_WELFARE_NASH | 42 | #define RIL_DEFAULT_WELFARE RIL_WELFARE_NASH |
43 | #define RIL_DEFAULT_DISCOUNT_BETA 2.0 | 43 | #define RIL_DEFAULT_DISCOUNT_BETA 0.6 |
44 | #define RIL_DEFAULT_DISCOUNT_GAMMA 0.5 | 44 | #define RIL_DEFAULT_DISCOUNT_GAMMA 0.5 |
45 | #define RIL_DEFAULT_GRADIENT_STEP_SIZE 0.001 | 45 | #define RIL_DEFAULT_GRADIENT_STEP_SIZE 0.001 |
46 | #define RIL_DEFAULT_TRACE_DECAY 0.5 | 46 | #define RIL_DEFAULT_TRACE_DECAY 0.5 |
47 | #define RIL_DEFAULT_EXPLORE_RATIO 1 | 47 | #define RIL_DEFAULT_EXPLORE_RATIO 1 |
48 | #define RIL_DEFAULT_EXPLORE_DECAY 0.95 | 48 | #define RIL_DEFAULT_EXPLORE_DECAY 0.95 |
49 | #define RIL_DEFAULT_RBF_DIVISOR 50 | 49 | #define RIL_DEFAULT_RBF_DIVISOR 50 |
50 | #define RIL_DEFAULT_TEMPERATURE 10 | 50 | #define RIL_DEFAULT_TEMPERATURE 0.1 |
51 | #define RIL_DEFAULT_TEMPERATURE_DECAY 0.999 | 51 | #define RIL_DEFAULT_TEMPERATURE_DECAY 1 |
52 | 52 | ||
53 | #define RIL_INC_DEC_STEP_SIZE 1 | 53 | #define RIL_INC_DEC_STEP_SIZE 1 |
54 | #define RIL_NOP_DECAY 0.5 | 54 | #define RIL_NOP_DECAY 0.5 |
@@ -99,7 +99,7 @@ enum RIL_Welfare | |||
99 | 99 | ||
100 | enum RIL_E_Modification | 100 | enum RIL_E_Modification |
101 | { | 101 | { |
102 | RIL_E_DISCOUNT, | 102 | RIL_E_DECAY, |
103 | RIL_E_ZERO, | 103 | RIL_E_ZERO, |
104 | RIL_E_ACCUMULATE, | 104 | RIL_E_ACCUMULATE, |
105 | RIL_E_REPLACE | 105 | RIL_E_REPLACE |
@@ -173,17 +173,17 @@ struct RIL_Learning_Parameters | |||
173 | /** | 173 | /** |
174 | * Initial exploration ratio value | 174 | * Initial exploration ratio value |
175 | */ | 175 | */ |
176 | double explore_ratio_init; | 176 | double epsilon_init; |
177 | 177 | ||
178 | /** | 178 | /** |
179 | * Ratio, with what probability an agent should explore in the e-greed policy | 179 | * Ratio, with what probability an agent should explore in the e-greed policy |
180 | */ | 180 | */ |
181 | double explore_ratio; | 181 | double epsilon; |
182 | 182 | ||
183 | /** | 183 | /** |
184 | * Decay factor of the explore ratio | 184 | * Decay factor of the explore ratio |
185 | */ | 185 | */ |
186 | double explore_ratio_decay; | 186 | double epsilon_decay; |
187 | 187 | ||
188 | /** | 188 | /** |
189 | * Minimal interval time between steps in milliseconds | 189 | * Minimal interval time between steps in milliseconds |
@@ -370,7 +370,7 @@ struct RIL_Scope | |||
370 | /** | 370 | /** |
371 | * Number of active agents in scope | 371 | * Number of active agents in scope |
372 | */ | 372 | */ |
373 | unsigned int agent_count; | 373 | unsigned int active_agent_count; |
374 | 374 | ||
375 | /** | 375 | /** |
376 | * The social welfare achieved in the scope | 376 | * The social welfare achieved in the scope |
@@ -724,7 +724,7 @@ agent_update (struct RIL_Peer_Agent *agent, double reward, double *s_next, int a | |||
724 | * Changes the eligibility trace vector e in various manners: | 724 | * Changes the eligibility trace vector e in various manners: |
725 | * #RIL_E_ACCUMULATE - adds @a feature to each component as in accumulating eligibility traces | 725 | * #RIL_E_ACCUMULATE - adds @a feature to each component as in accumulating eligibility traces |
726 | * #RIL_E_REPLACE - resets each component to @a feature as in replacing traces | 726 | * #RIL_E_REPLACE - resets each component to @a feature as in replacing traces |
727 | * #RIL_E_DISCOUNT - multiplies e with discount factor and lambda as in the update rule | 727 | * #RIL_E_DECAY - multiplies e with discount factor and lambda as in the update rule |
728 | * #RIL_E_ZERO - sets e to 0 as in Watkin's Q-learning algorithm when exploring and when initializing | 728 | * #RIL_E_ZERO - sets e to 0 as in Watkin's Q-learning algorithm when exploring and when initializing |
729 | * | 729 | * |
730 | * @param agent the agent handle | 730 | * @param agent the agent handle |
@@ -750,7 +750,7 @@ agent_modify_eligibility (struct RIL_Peer_Agent *agent, | |||
750 | case RIL_E_REPLACE: | 750 | case RIL_E_REPLACE: |
751 | agent->E[action][i] = agent->E[action][i] > feature[i] ? agent->E[action][i] : feature[i]; | 751 | agent->E[action][i] = agent->E[action][i] > feature[i] ? agent->E[action][i] : feature[i]; |
752 | break; | 752 | break; |
753 | case RIL_E_DISCOUNT: | 753 | case RIL_E_DECAY: |
754 | for (k = 0; k < agent->n; k++) | 754 | for (k = 0; k < agent->n; k++) |
755 | { | 755 | { |
756 | agent->E[k][i] *= agent->envi->global_discount_variable * agent->envi->parameters.lambda; | 756 | agent->E[k][i] *= agent->envi->global_discount_variable * agent->envi->parameters.lambda; |
@@ -964,7 +964,7 @@ agent_get_utility (struct RIL_Peer_Agent *agent) | |||
964 | 964 | ||
965 | pref_match = preferences[GNUNET_ATS_PREFERENCE_LATENCY] * delay_norm; | 965 | pref_match = preferences[GNUNET_ATS_PREFERENCE_LATENCY] * delay_norm; |
966 | pref_match += preferences[GNUNET_ATS_PREFERENCE_BANDWIDTH] * | 966 | pref_match += preferences[GNUNET_ATS_PREFERENCE_BANDWIDTH] * |
967 | sqrt((double) (agent->bw_in/RIL_MIN_BW) * (double) (agent->bw_out/RIL_MIN_BW)); | 967 | sqrt((double) (ril_get_atsi (agent->address_inuse, GNUNET_ATS_UTILIZATION_IN)/RIL_MIN_BW) * (double) (ril_get_atsi (agent->address_inuse, GNUNET_ATS_UTILIZATION_OUT)/RIL_MIN_BW)); |
968 | 968 | ||
969 | // return (double) (agent->bw_in/RIL_MIN_BW); | 969 | // return (double) (agent->bw_in/RIL_MIN_BW); |
970 | // return sqrt((double) (agent->bw_in/RIL_MIN_BW) * (double) (agent->bw_out/RIL_MIN_BW)); | 970 | // return sqrt((double) (agent->bw_in/RIL_MIN_BW) * (double) (agent->bw_out/RIL_MIN_BW)); |
@@ -1004,7 +1004,7 @@ ril_network_get_social_welfare (struct GAS_RIL_Handle *solver, struct RIL_Scope | |||
1004 | { | 1004 | { |
1005 | if (cur->is_active && cur->address_inuse && (cur->address_inuse->solver_information == scope)) | 1005 | if (cur->is_active && cur->address_inuse && (cur->address_inuse->solver_information == scope)) |
1006 | { | 1006 | { |
1007 | result *= pow(agent_get_utility(cur), 1.0 / (double) scope->agent_count); | 1007 | result *= pow(agent_get_utility(cur), 1.0 / (double) scope->active_agent_count); |
1008 | } | 1008 | } |
1009 | } | 1009 | } |
1010 | return result; | 1010 | return result; |
@@ -1039,7 +1039,7 @@ envi_get_penalty (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent) | |||
1039 | over_out *= 2; | 1039 | over_out *= 2; |
1040 | } | 1040 | } |
1041 | } | 1041 | } |
1042 | over_max = GNUNET_MAX (over_in , over_out) / RIL_MIN_BW; | 1042 | over_max = (over_in + over_out) / RIL_MIN_BW; |
1043 | 1043 | ||
1044 | return -1.0 * (double) over_max; | 1044 | return -1.0 * (double) over_max; |
1045 | } | 1045 | } |
@@ -1065,11 +1065,12 @@ envi_get_reward (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent) | |||
1065 | 1065 | ||
1066 | net = agent->address_inuse->solver_information; | 1066 | net = agent->address_inuse->solver_information; |
1067 | 1067 | ||
1068 | penalty = envi_get_penalty(solver, agent); | ||
1068 | objective = (agent_get_utility (agent) + net->social_welfare) / 2; | 1069 | objective = (agent_get_utility (agent) + net->social_welfare) / 2; |
1069 | delta = objective - agent->objective_old; | 1070 | delta = objective - agent->objective_old; |
1070 | agent->objective_old = objective; | 1071 | agent->objective_old = objective; |
1071 | 1072 | ||
1072 | if (delta != 0) | 1073 | if (delta != 0 && penalty == 0) |
1073 | { | 1074 | { |
1074 | agent->nop_bonus = delta * RIL_NOP_DECAY; | 1075 | agent->nop_bonus = delta * RIL_NOP_DECAY; |
1075 | } | 1076 | } |
@@ -1080,8 +1081,6 @@ envi_get_reward (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *agent) | |||
1080 | 1081 | ||
1081 | steady = (RIL_ACTION_NOTHING == agent->a_old) ? agent->nop_bonus : 0; | 1082 | steady = (RIL_ACTION_NOTHING == agent->a_old) ? agent->nop_bonus : 0; |
1082 | 1083 | ||
1083 | penalty = envi_get_penalty(solver, agent); | ||
1084 | |||
1085 | reward = delta + steady; | 1084 | reward = delta + steady; |
1086 | return reward + penalty; | 1085 | return reward + penalty; |
1087 | } | 1086 | } |
@@ -1323,14 +1322,14 @@ agent_select_egreedy (struct RIL_Peer_Agent *agent, double *state) | |||
1323 | double r = (double) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 1322 | double r = (double) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, |
1324 | UINT32_MAX) / (double) UINT32_MAX; | 1323 | UINT32_MAX) / (double) UINT32_MAX; |
1325 | 1324 | ||
1326 | if (r < agent->envi->parameters.explore_ratio) //explore | 1325 | if (r < agent->envi->parameters.epsilon) //explore |
1327 | { | 1326 | { |
1328 | action = agent_get_action_random(agent); | 1327 | action = agent_get_action_random(agent); |
1329 | if (RIL_ALGO_Q == agent->envi->parameters.algorithm) | 1328 | if (RIL_ALGO_Q == agent->envi->parameters.algorithm) |
1330 | { | 1329 | { |
1331 | agent->eligibility_reset = GNUNET_YES; | 1330 | agent->eligibility_reset = GNUNET_YES; |
1332 | } | 1331 | } |
1333 | agent->envi->parameters.explore_ratio *= agent->envi->parameters.explore_ratio_decay; | 1332 | agent->envi->parameters.epsilon *= agent->envi->parameters.epsilon_decay; |
1334 | return action; | 1333 | return action; |
1335 | } | 1334 | } |
1336 | else //exploit | 1335 | else //exploit |
@@ -1452,7 +1451,7 @@ agent_step (struct RIL_Peer_Agent *agent) | |||
1452 | } | 1451 | } |
1453 | else | 1452 | else |
1454 | { | 1453 | { |
1455 | agent_modify_eligibility (agent, RIL_E_DISCOUNT, NULL, -1); | 1454 | agent_modify_eligibility (agent, RIL_E_DECAY, NULL, -1); |
1456 | } | 1455 | } |
1457 | if (RIL_ACTION_INVALID != agent->a_old) | 1456 | if (RIL_ACTION_INVALID != agent->a_old) |
1458 | { | 1457 | { |
@@ -1632,6 +1631,8 @@ ril_try_unblock_agent (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *age | |||
1632 | { | 1631 | { |
1633 | struct RIL_Address_Wrapped *addr_wrap; | 1632 | struct RIL_Address_Wrapped *addr_wrap; |
1634 | struct RIL_Scope *net; | 1633 | struct RIL_Scope *net; |
1634 | unsigned long long start_in; | ||
1635 | unsigned long long start_out; | ||
1635 | 1636 | ||
1636 | for (addr_wrap = agent->addresses_head; NULL != addr_wrap; addr_wrap = addr_wrap->next) | 1637 | for (addr_wrap = agent->addresses_head; NULL != addr_wrap; addr_wrap = addr_wrap->next) |
1637 | { | 1638 | { |
@@ -1639,7 +1640,11 @@ ril_try_unblock_agent (struct GAS_RIL_Handle *solver, struct RIL_Peer_Agent *age | |||
1639 | if (ril_network_is_not_full(solver, net->type)) | 1640 | if (ril_network_is_not_full(solver, net->type)) |
1640 | { | 1641 | { |
1641 | if (NULL == agent->address_inuse) | 1642 | if (NULL == agent->address_inuse) |
1642 | envi_set_active_suggestion (solver, agent, addr_wrap->address_naked, agent->bw_in, agent->bw_out, silent); | 1643 | { |
1644 | start_in = net->bw_in_available < net->bw_in_utilized ? (net->bw_in_available - net->bw_in_utilized) / 2 : RIL_MIN_BW; | ||
1645 | start_out = net->bw_out_available < net->bw_out_utilized ? (net->bw_out_available - net->bw_out_utilized) / 2 : RIL_MIN_BW; | ||
1646 | envi_set_active_suggestion (solver, agent, addr_wrap->address_naked, start_in, start_out, silent); | ||
1647 | } | ||
1643 | return; | 1648 | return; |
1644 | } | 1649 | } |
1645 | } | 1650 | } |
@@ -1794,7 +1799,7 @@ ril_networks_update_state (struct GAS_RIL_Handle *solver) | |||
1794 | net->bw_in_utilized = ril_network_get_utilized(solver, net->type, GNUNET_YES); | 1799 | net->bw_in_utilized = ril_network_get_utilized(solver, net->type, GNUNET_YES); |
1795 | net->bw_out_assigned = ril_network_get_assigned(solver, net->type, GNUNET_NO); | 1800 | net->bw_out_assigned = ril_network_get_assigned(solver, net->type, GNUNET_NO); |
1796 | net->bw_out_utilized = ril_network_get_utilized(solver, net->type, GNUNET_NO); | 1801 | net->bw_out_utilized = ril_network_get_utilized(solver, net->type, GNUNET_NO); |
1797 | net->agent_count = ril_network_count_active_agents(solver, net); | 1802 | net->active_agent_count = ril_network_count_active_agents(solver, net); |
1798 | net->social_welfare = ril_network_get_social_welfare(solver, net); | 1803 | net->social_welfare = ril_network_get_social_welfare(solver, net); |
1799 | } | 1804 | } |
1800 | } | 1805 | } |
@@ -2118,7 +2123,7 @@ GAS_ril_address_change_preference (void *solver, | |||
2118 | struct GAS_RIL_Handle *s = solver; | 2123 | struct GAS_RIL_Handle *s = solver; |
2119 | 2124 | ||
2120 | s->parameters.temperature = s->parameters.temperature_init; | 2125 | s->parameters.temperature = s->parameters.temperature_init; |
2121 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2126 | s->parameters.epsilon = s->parameters.epsilon_init; |
2122 | ril_step (s); | 2127 | ril_step (s); |
2123 | } | 2128 | } |
2124 | 2129 | ||
@@ -2247,32 +2252,32 @@ libgnunet_plugin_ats_ril_init (void *cls) | |||
2247 | 2252 | ||
2248 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (env->cfg, "ats", "RIL_EXPLORE_RATIO", &string)) | 2253 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (env->cfg, "ats", "RIL_EXPLORE_RATIO", &string)) |
2249 | { | 2254 | { |
2250 | solver->parameters.explore_ratio_init = strtod (string, NULL); | 2255 | solver->parameters.epsilon_init = strtod (string, NULL); |
2251 | GNUNET_free (string); | 2256 | GNUNET_free (string); |
2252 | if (solver->parameters.explore_ratio_init < 0 || solver->parameters.explore_ratio_init > 1) | 2257 | if (solver->parameters.epsilon_init < 0 || solver->parameters.epsilon_init > 1) |
2253 | { | 2258 | { |
2254 | LOG (GNUNET_ERROR_TYPE_WARNING, "RIL_EXPLORE_RATIO not configured in range [0,1]. Set to default value of %f instead.\n", RIL_DEFAULT_EXPLORE_RATIO); | 2259 | LOG (GNUNET_ERROR_TYPE_WARNING, "RIL_EXPLORE_RATIO not configured in range [0,1]. Set to default value of %f instead.\n", RIL_DEFAULT_EXPLORE_RATIO); |
2255 | solver->parameters.explore_ratio_init = RIL_DEFAULT_EXPLORE_RATIO; | 2260 | solver->parameters.epsilon_init = RIL_DEFAULT_EXPLORE_RATIO; |
2256 | } | 2261 | } |
2257 | } | 2262 | } |
2258 | else | 2263 | else |
2259 | { | 2264 | { |
2260 | solver->parameters.explore_ratio_init = RIL_DEFAULT_EXPLORE_RATIO; | 2265 | solver->parameters.epsilon_init = RIL_DEFAULT_EXPLORE_RATIO; |
2261 | } | 2266 | } |
2262 | 2267 | ||
2263 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (env->cfg, "ats", "RIL_EXPLORE_DECAY", &string)) | 2268 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (env->cfg, "ats", "RIL_EXPLORE_DECAY", &string)) |
2264 | { | 2269 | { |
2265 | solver->parameters.explore_ratio_decay = strtod (string, NULL); | 2270 | solver->parameters.epsilon_decay = strtod (string, NULL); |
2266 | GNUNET_free (string); | 2271 | GNUNET_free (string); |
2267 | if (solver->parameters.explore_ratio_decay < 0 || solver->parameters.explore_ratio_decay > 1) | 2272 | if (solver->parameters.epsilon_decay < 0 || solver->parameters.epsilon_decay > 1) |
2268 | { | 2273 | { |
2269 | LOG (GNUNET_ERROR_TYPE_WARNING, "RIL_EXPLORE_RATIO not configured in range [0,1]. Set to default value of %f instead.\n", RIL_DEFAULT_EXPLORE_DECAY); | 2274 | LOG (GNUNET_ERROR_TYPE_WARNING, "RIL_EXPLORE_RATIO not configured in range [0,1]. Set to default value of %f instead.\n", RIL_DEFAULT_EXPLORE_DECAY); |
2270 | solver->parameters.explore_ratio_decay = RIL_DEFAULT_EXPLORE_DECAY; | 2275 | solver->parameters.epsilon_decay = RIL_DEFAULT_EXPLORE_DECAY; |
2271 | } | 2276 | } |
2272 | } | 2277 | } |
2273 | else | 2278 | else |
2274 | { | 2279 | { |
2275 | solver->parameters.explore_ratio_decay = RIL_DEFAULT_EXPLORE_DECAY; | 2280 | solver->parameters.epsilon_decay = RIL_DEFAULT_EXPLORE_DECAY; |
2276 | } | 2281 | } |
2277 | 2282 | ||
2278 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (env->cfg, "ats", "RIL_TEMPERATURE", &string)) | 2283 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (env->cfg, "ats", "RIL_TEMPERATURE", &string)) |
@@ -2364,7 +2369,7 @@ libgnunet_plugin_ats_ril_init (void *cls) | |||
2364 | solver->parameters.beta, | 2369 | solver->parameters.beta, |
2365 | solver->parameters.lambda); | 2370 | solver->parameters.lambda); |
2366 | LOG(GNUNET_ERROR_TYPE_DEBUG, "init() exploration_ratio = %f, temperature = %f, ActionSelection = %s\n", | 2371 | LOG(GNUNET_ERROR_TYPE_DEBUG, "init() exploration_ratio = %f, temperature = %f, ActionSelection = %s\n", |
2367 | solver->parameters.explore_ratio, | 2372 | solver->parameters.epsilon, |
2368 | solver->parameters.temperature, | 2373 | solver->parameters.temperature, |
2369 | solver->parameters.select ? "EGREEDY" : "SOFTMAX"); | 2374 | solver->parameters.select ? "EGREEDY" : "SOFTMAX"); |
2370 | LOG(GNUNET_ERROR_TYPE_DEBUG, "init() RBF_DIVISOR = %llu\n", | 2375 | LOG(GNUNET_ERROR_TYPE_DEBUG, "init() RBF_DIVISOR = %llu\n", |
@@ -2445,7 +2450,7 @@ GAS_ril_address_add (void *solver, struct ATS_Address *address, uint32_t network | |||
2445 | } | 2450 | } |
2446 | 2451 | ||
2447 | s->parameters.temperature = s->parameters.temperature_init; | 2452 | s->parameters.temperature = s->parameters.temperature_init; |
2448 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2453 | s->parameters.epsilon = s->parameters.epsilon_init; |
2449 | 2454 | ||
2450 | agent = ril_get_agent (s, &address->peer, GNUNET_YES); | 2455 | agent = ril_get_agent (s, &address->peer, GNUNET_YES); |
2451 | 2456 | ||
@@ -2531,7 +2536,7 @@ GAS_ril_address_delete (void *solver, struct ATS_Address *address, int session_o | |||
2531 | } | 2536 | } |
2532 | 2537 | ||
2533 | s->parameters.temperature = s->parameters.temperature_init; | 2538 | s->parameters.temperature = s->parameters.temperature_init; |
2534 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2539 | s->parameters.epsilon = s->parameters.epsilon_init; |
2535 | 2540 | ||
2536 | address_index = agent_address_get_index (agent, address); | 2541 | address_index = agent_address_get_index (agent, address); |
2537 | address_wrapped = agent_address_get_wrapped (agent, address); | 2542 | address_wrapped = agent_address_get_wrapped (agent, address); |
@@ -2622,7 +2627,7 @@ GAS_ril_address_property_changed (void *solver, | |||
2622 | struct GAS_RIL_Handle *s = solver; | 2627 | struct GAS_RIL_Handle *s = solver; |
2623 | 2628 | ||
2624 | s->parameters.temperature = s->parameters.temperature_init; | 2629 | s->parameters.temperature = s->parameters.temperature_init; |
2625 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2630 | s->parameters.epsilon = s->parameters.epsilon_init; |
2626 | ril_step (s); | 2631 | ril_step (s); |
2627 | } | 2632 | } |
2628 | 2633 | ||
@@ -2688,7 +2693,7 @@ GAS_ril_address_change_network (void *solver, | |||
2688 | GNUNET_ATS_print_network_type (current_network), GNUNET_ATS_print_network_type (new_network)); | 2693 | GNUNET_ATS_print_network_type (current_network), GNUNET_ATS_print_network_type (new_network)); |
2689 | 2694 | ||
2690 | s->parameters.temperature = s->parameters.temperature_init; | 2695 | s->parameters.temperature = s->parameters.temperature_init; |
2691 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2696 | s->parameters.epsilon = s->parameters.epsilon_init; |
2692 | 2697 | ||
2693 | if (address->active && !ril_network_is_active (solver, new_network)) | 2698 | if (address->active && !ril_network_is_active (solver, new_network)) |
2694 | { | 2699 | { |
@@ -2810,7 +2815,7 @@ GAS_ril_get_preferred_address (void *solver, const struct GNUNET_PeerIdentity *p | |||
2810 | "API_get_preferred_address() Activated agent for peer '%s', but no address available\n", | 2815 | "API_get_preferred_address() Activated agent for peer '%s', but no address available\n", |
2811 | GNUNET_i2s (peer)); | 2816 | GNUNET_i2s (peer)); |
2812 | s->parameters.temperature = s->parameters.temperature_init; | 2817 | s->parameters.temperature = s->parameters.temperature_init; |
2813 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2818 | s->parameters.epsilon = s->parameters.epsilon_init; |
2814 | } | 2819 | } |
2815 | return agent->address_inuse; | 2820 | return agent->address_inuse; |
2816 | } | 2821 | } |
@@ -2846,7 +2851,7 @@ GAS_ril_stop_get_preferred_address (void *solver, const struct GNUNET_PeerIdenti | |||
2846 | } | 2851 | } |
2847 | 2852 | ||
2848 | s->parameters.temperature = s->parameters.temperature_init; | 2853 | s->parameters.temperature = s->parameters.temperature_init; |
2849 | s->parameters.explore_ratio = s->parameters.explore_ratio_init; | 2854 | s->parameters.epsilon = s->parameters.epsilon_init; |
2850 | 2855 | ||
2851 | agent->is_active = GNUNET_NO; | 2856 | agent->is_active = GNUNET_NO; |
2852 | 2857 | ||