fal->quality[c].values[1] = fal->quality[c].values[2];
fal->quality[c].values[2] = value;
set = GNUNET_YES;
+#if HAVE_GLPK
ats_modify_problem_state (ats, ATS_QUALITY_UPDATED);
+#endif
}
}
if (set == GNUNET_NO)
{
fal->ressources[c].c = value;
set = GNUNET_YES;
+#if HAVE_GLPK
ats_modify_problem_state (ats, ATS_COST_UPDATED);
+#endif
}
}
}
}
GNUNET_free_non_null(pos->ressources);
GNUNET_free_non_null(pos->quality);
+#if HAVE_GLPK
ats_modify_problem_state (ats, ATS_MODIFIED);
-
+#endif
if (GNUNET_YES != pos->connected)
{
/* nothing else to do, connection was never up... */
/* notify ats about connecting peer */
if ((ats != NULL) && (shutdown_in_progress == GNUNET_NO))
{
+#if HAVE_GLPK
ats_modify_problem_state(ats, ATS_MODIFIED);
ats_calculate_bandwidth_distribution (ats, stats);
+#endif
}
cpos = clients;
while (cpos != NULL)
/* notify ats about connecting peer */
if ((ats != NULL) && (shutdown_in_progress == GNUNET_NO))
{
+#if HAVE_GLPK
ats_modify_problem_state(ats, ATS_MODIFIED);
ats_calculate_bandwidth_distribution (ats, stats);
+#endif
}
cpos = clients;
n->received_pong = GNUNET_NO;
notify_clients_disconnect (&n->id);
}
-
+#if HAVE_GLPK
ats_modify_problem_state(ats, ATS_MODIFIED);
-
+#endif
/* clean up all plugins, cancel connections and pending transmissions */
while (NULL != (rpos = n->plugins))
{
if ((ntohs(message->type) == GNUNET_MESSAGE_TYPE_TRANSPORT_ATS) &&
(ntohs(message->size) == (sizeof (struct GNUNET_MessageHeader) + sizeof (uint32_t))))
{
+#if HAVE_GLPK
uint32_t value = ntohl(*((uint32_t *) &message[1]));
//GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "GNUNET_MESSAGE_TYPE_TRANSPORT_ATS: %i \n", value);
/* Force ressource and quality update */
/* Force full rebuild */
if ((value == 1) && (ats != NULL))
ats_modify_problem_state(ats, ATS_MODIFIED);
+#endif
}
#if DEBUG_PING_PONG
GNUNET_SCHEDULER_cancel(ats_task);
ats_task = GNUNET_SCHEDULER_NO_TASK;
}
+#if HAVE_GLPK
if (ats != NULL)
ats_shutdown (ats);
+#endif
/* free 'chvc' data structure */
while (NULL != (chvc = chvc_head))
#if DEBUG_ATS
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Running scheduled calculation\n");
#endif
+#if HAVE_GLPK
ats_calculate_bandwidth_distribution (ats, stats);
+#endif
last_ats_execution = GNUNET_TIME_absolute_get();
ats_task = GNUNET_SCHEDULER_add_delayed (ats_regular_interval,
int co;
char * section;
unsigned long long value;
-
+#if HAVE_GLPK
double D = 1.0;
double U = 1.0;
double R = 1.0;
int v_b_min = 64000;
int v_n_min = 5;
+#endif
ats_minimum_interval = ATS_MIN_INTERVAL;
ats_regular_interval = ATS_EXEC_INTERVAL;
}
GNUNET_free (section);
}
-
+#if HAVE_GLPK
ats = ats_init (D, U, R, v_b_min, v_n_min,
ATS_MAX_ITERATIONS, ATS_MAX_EXEC_DURATION,
create_ats_information,
ats_result_cb);
+#endif
int log_problem = GNUNET_NO;
int log_solution = GNUNET_NO;
"transport",
"ATS_MIN_INTERVAL",
&ats_minimum_interval));
+#if HAVE_GLPK
ats_set_logging_options (ats,
minimum_addresses,
minimum_peers,
overwrite_dump,
log_solution,
log_problem);
-
+#endif
if (ats != NULL)
ats_task = GNUNET_SCHEDULER_add_now (&schedule_ats, ats);