aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_addresses.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.c')
-rw-r--r--src/ats/gnunet-service-ats_addresses.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 8693293d0..06eee9fb3 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -536,55 +536,6 @@ void
536GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 536GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
537 const struct GNUNET_STATISTICS_Handle *stats) 537 const struct GNUNET_STATISTICS_Handle *stats)
538{ 538{
539#if HAVE_LIBGLPK
540 double D;
541 double R;
542 double U;
543 long long unsigned int tmp;
544 unsigned int b_min;
545 unsigned int n_min;
546
547 /* Get diversity coefficient from configuration */
548 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
549 "COEFFICIENT_D",
550 &tmp))
551 D = (double) tmp / 100;
552 else
553 D = 1.0;
554
555 /* Get proportionality coefficient from configuration */
556 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
557 "COEFFICIENT_R",
558 &tmp))
559 R = (double) tmp / 100;
560 else
561 R = 1.0;
562
563 /* Get utilization coefficient from configuration */
564 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
565 "COEFFICIENT_U",
566 &tmp))
567 U = (double) tmp / 100;
568 else
569 U = 1.0;
570
571 /* Get minimum bandwidth per used address from configuration */
572 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
573 "MIN_BANDWIDTH",
574 &tmp))
575 b_min = tmp;
576 else
577 b_min = 64000;
578
579 /* Get minimum number of connections from configuration */
580 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
581 "MIN_CONNECTIONS",
582 &tmp))
583 n_min = tmp;
584 else
585 n_min = 4;
586#endif
587
588 GNUNET_assert (GNUNET_OK == 539 GNUNET_assert (GNUNET_OK ==
589 GNUNET_CONFIGURATION_get_value_size (cfg, "ats", 540 GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
590 "WAN_QUOTA_IN", 541 "WAN_QUOTA_IN",
@@ -601,7 +552,7 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
601#if HAVE_LIBGLPK 552#if HAVE_LIBGLPK
602 ats_mode = MLP; 553 ats_mode = MLP;
603 /* Init the MLP solver with default values */ 554 /* Init the MLP solver with default values */
604 mlp = GAS_mlp_init (stats, MLP_MAX_EXEC_DURATION, MLP_MAX_ITERATIONS, D, U, R, b_min, n_min); 555 mlp = GAS_mlp_init (cfg, stats, MLP_MAX_EXEC_DURATION, MLP_MAX_ITERATIONS);
605 break; 556 break;
606#else 557#else
607 558