GNUNET_asprintf(&name, "c2_%s", GNUNET_i2s(&address->peer));
peer->r_c2 = mlp_create_problem_create_constraint (p, name, GLP_FX, 1.0, 1.0);
GNUNET_free (name);
- if (GNUNET_NO == mlp->opt_feasibility_only)
+ if (GNUNET_NO == mlp->opt_dbg_feasibility_only)
{
/* Add c9) Relativity */
GNUNET_asprintf(&name, "c9_%s", GNUNET_i2s(&address->peer));
/* Add bandwidth column */
GNUNET_asprintf (&name, "b_%s_%s_%p", GNUNET_i2s (&address->peer), address->plugin, address);
- if (GNUNET_NO == mlp->opt_feasibility_only)
+ if (GNUNET_NO == mlp->opt_dbg_feasibility_only)
{
mlpi->c_b = mlp_create_problem_create_column (p, name, GLP_CV, GLP_LO, 0.0, 0.0, 0.0);
}
}
/* Optimality */
- if (GNUNET_NO == mlp->opt_feasibility_only)
+ if (GNUNET_NO == mlp->opt_dbg_feasibility_only)
{
/* c 6) maximize diversity */
mlp_create_problem_set_value (p, p->r_c6, mlpi->c_n, 1, __LINE__);
}
/* Optimality */
- if (GNUNET_NO == mlp->opt_feasibility_only)
+ if (GNUNET_NO == mlp->opt_dbg_feasibility_only)
{
char *name;
/* Add row for c6) Maximize for diversity */
static void
mlp_create_problem_add_invariant_columns (struct GAS_MLP_Handle *mlp, struct MLP_Problem *p)
{
- if (GNUNET_NO == mlp->opt_feasibility_only)
+ if (GNUNET_NO == mlp->opt_dbg_feasibility_only)
{
char *name;
int c;
/* Load the matrix */
LOG (GNUNET_ERROR_TYPE_DEBUG, "Loading matrix\n");
glp_load_matrix(p->prob, (p->ci)-1, p->ia, p->ja, p->ar);
- glp_scale_prob (p->prob, GLP_SF_AUTO);
+ if (GNUNET_YES == mlp->opt_dbg_autoscale_problem)
+ {
+ glp_scale_prob (p->prob, GLP_SF_AUTO);
+ }
return res;
}
abs_value,
rel_value);
- if (GNUNET_YES == mlp->opt_feasibility_only)
+ if (GNUNET_YES == mlp->opt_dbg_feasibility_only)
return;
/* Find row index */
return;
}
- if (GNUNET_NO == mlp->opt_feasibility_only)
+ if (GNUNET_NO == mlp->opt_dbg_feasibility_only)
{
p->f = get_peer_pref_value (mlp, peer);
mlp_create_problem_update_value (&mlp->p, p->r_c9, mlp->p.c_r, -p->f, __LINE__);
if (GNUNET_SYSERR == mlp->opt_dump_solution_on_fail)
mlp->opt_dump_solution_on_fail = GNUNET_NO;
- mlp->opt_glpk_verbose = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
+ mlp->opt_dbg_glpk_verbose = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
"ats", "MLP_GLPK_VERBOSE");
- if (GNUNET_SYSERR == mlp->opt_glpk_verbose)
- mlp->opt_glpk_verbose = GNUNET_NO;
-
- mlp->opt_feasibility_only = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
- "ats", "MLP_FEASIBILITY_ONLY");
- if (GNUNET_SYSERR == mlp->opt_feasibility_only)
- mlp->opt_feasibility_only = GNUNET_NO;
- if (GNUNET_YES == mlp->opt_feasibility_only)
+ if (GNUNET_SYSERR == mlp->opt_dbg_glpk_verbose)
+ mlp->opt_dbg_glpk_verbose = GNUNET_NO;
+
+ mlp->opt_dbg_feasibility_only = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
+ "ats", "MLP_DBG_FEASIBILITY_ONLY");
+ if (GNUNET_SYSERR == mlp->opt_dbg_feasibility_only)
+ mlp->opt_dbg_feasibility_only = GNUNET_NO;
+ if (GNUNET_YES == mlp->opt_dbg_feasibility_only)
LOG (GNUNET_ERROR_TYPE_WARNING,
"MLP solver is configured to check feasibility only!\n");
+ mlp->opt_dbg_autoscale_problem = GNUNET_CONFIGURATION_get_value_yesno (env->cfg,
+ "ats", "MLP_DBG_AUTOSCALE_PROBLEM");
+ if (GNUNET_SYSERR == mlp->opt_dbg_autoscale_problem)
+ mlp->opt_dbg_autoscale_problem = GNUNET_NO;
+ if (GNUNET_YES == mlp->opt_dbg_autoscale_problem)
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "MLP solver is configured automatically scale the problem!\n");
+
mlp->pv.BIG_M = (double) BIG_M_VALUE;
/* Get timeout for iterations */
/* Init LP solving parameters */
glp_init_smcp(&mlp->control_param_lp);
mlp->control_param_lp.msg_lev = GLP_MSG_OFF;
- if (GNUNET_YES == mlp->opt_glpk_verbose)
+ if (GNUNET_YES == mlp->opt_dbg_glpk_verbose)
mlp->control_param_lp.msg_lev = GLP_MSG_ALL;
mlp->control_param_lp.it_lim = max_iterations;
/* Init MLP solving parameters */
glp_init_iocp(&mlp->control_param_mlp);
mlp->control_param_mlp.msg_lev = GLP_MSG_OFF;
- if (GNUNET_YES == mlp->opt_glpk_verbose)
+ if (GNUNET_YES == mlp->opt_dbg_glpk_verbose)
mlp->control_param_mlp.msg_lev = GLP_MSG_ALL;
mlp->control_param_mlp.tm_lim = max_duration.rel_value_us / 1000LL;