aboutsummaryrefslogtreecommitdiff
path: root/src/ats/plugin_ats_mlp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-08 11:46:36 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-08 11:46:36 +0000
commit6115a1150c65bd4a33ed61c6e96594c4a73d86ac (patch)
treef2bb2a57f540a3799cd112b5235f1c4222fd283e /src/ats/plugin_ats_mlp.c
parentcd0a6e382eafd7fd241a00a10527333d73985fca (diff)
downloadgnunet-6115a1150c65bd4a33ed61c6e96594c4a73d86ac.tar.gz
gnunet-6115a1150c65bd4a33ed61c6e96594c4a73d86ac.zip
more dead and duplicate code elimination
Diffstat (limited to 'src/ats/plugin_ats_mlp.c')
-rw-r--r--src/ats/plugin_ats_mlp.c42
1 files changed, 2 insertions, 40 deletions
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index fbaed1eaa..89be5ae7d 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -597,45 +597,6 @@ mlp_delete_problem (struct GAS_MLP_Handle *mlp)
597 597
598 598
599/** 599/**
600 * Translate ATS properties to text
601 * Just intended for debugging
602 *
603 * @param ats_index the ATS index
604 * @return string with result
605 */
606static const char *
607mlp_ats_to_string (int ats_index)
608{
609 switch (ats_index) {
610 case GNUNET_ATS_ARRAY_TERMINATOR:
611 return "GNUNET_ATS_ARRAY_TERMINATOR";
612 case GNUNET_ATS_UTILIZATION_OUT:
613 return "GNUNET_ATS_UTILIZATION_OUT";
614 case GNUNET_ATS_UTILIZATION_IN:
615 return "GNUNET_ATS_UTILIZATION_IN";
616 case GNUNET_ATS_UTILIZATION_PAYLOAD_OUT:
617 return "GNUNET_ATS_UTILIZATION_PAYLOAD_OUT";
618 case GNUNET_ATS_UTILIZATION_PAYLOAD_IN:
619 return "GNUNET_ATS_UTILIZATION_PAYLOAD_IN";
620 case GNUNET_ATS_COST_LAN:
621 return "GNUNET_ATS_COST_LAN";
622 case GNUNET_ATS_COST_WAN:
623 return "GNUNET_ATS_COST_LAN";
624 case GNUNET_ATS_COST_WLAN:
625 return "GNUNET_ATS_COST_WLAN";
626 case GNUNET_ATS_NETWORK_TYPE:
627 return "GNUNET_ATS_NETWORK_TYPE";
628 case GNUNET_ATS_QUALITY_NET_DELAY:
629 return "GNUNET_ATS_QUALITY_NET_DELAY";
630 case GNUNET_ATS_QUALITY_NET_DISTANCE:
631 return "GNUNET_ATS_QUALITY_NET_DISTANCE";
632 default:
633 GNUNET_break (0);
634 return "unknown";
635 }
636}
637
638/**
639 * Translate glpk status error codes to text 600 * Translate glpk status error codes to text
640 * @param retcode return code 601 * @param retcode return code
641 * @return string with result 602 * @return string with result
@@ -1217,7 +1178,8 @@ mlp_create_problem_add_invariant_rows (struct GAS_MLP_Handle *mlp, struct MLP_Pr
1217 { 1178 {
1218 for (c = 0; c < mlp->pv.m_q; c++) 1179 for (c = 0; c < mlp->pv.m_q; c++)
1219 { 1180 {
1220 GNUNET_asprintf(&name, "c7_q%i_%s", c, mlp_ats_to_string(mlp->pv.q[c])); 1181 GNUNET_asprintf (&name, "c7_q%i_%s", c,
1182 GNUNET_ATS_print_property_type (mlp->pv.q[c]));
1221 p->r_q[c] = mlp_create_problem_create_constraint (p, name, GLP_FX, 0.0, 0.0); 1183 p->r_q[c] = mlp_create_problem_create_constraint (p, name, GLP_FX, 0.0, 0.0);
1222 GNUNET_free (name); 1184 GNUNET_free (name);
1223 mlp_create_problem_set_value (p, p->r_q[c], p->c_q[c], -1, __LINE__); 1185 mlp_create_problem_set_value (p, p->r_q[c], p->c_q[c], -1, __LINE__);