* b_t + (-M) * n_t <= 0
* */
GNUNET_asprintf(&name, "c1_%s_%s", GNUNET_i2s(&address->peer), address->plugin);
- mlpi->r_c1 = mlp_create_problem_create_constraint (p, name, GLP_LO, 0.0, 0.0);
+ mlpi->r_c1 = mlp_create_problem_create_constraint (p, name, GLP_UP, 0.0, 0.0);
GNUNET_free (name);
/* c1) set b = 1 coefficient */
/* c3) set b = 1 coefficient */
mlp_create_problem_set_value (p, mlpi->r_c3, mlpi->c_b, 1, __LINE__);
/* c3) set n = -b_min coefficient */
- mlp_create_problem_set_value (p, mlpi->r_c3, mlpi->c_n, -mlp->pv.b_min, __LINE__);
+ mlp_create_problem_set_value (p, mlpi->r_c3, mlpi->c_n, - ((double )mlp->pv.b_min), __LINE__);
/* Set coefficient entries in invariant rows */
/* c 7) Optimize quality */
/* For all quality metrics, set quality of this address */
for (c = 0; c < mlp->pv.m_q; c++)
- {
-#if 0
- mlpi = ta->solver_information;
- value = mlpi->q_averaged[c];
-
- mlpi->r_q[c] = p->r_q[c];
-
- ia[p->ci] = p->r_q[c];
- ja[p->ci] = mlpi->c_b;
- ar[p->ci] = tp->f_q[c] * value;
-#if DEBUG_MLP_PROBLEM_CREATION
- LOG (GNUNET_ERROR_TYPE_DEBUG, "[P]: Set value [%u,%u] == %.2f\n",
- p->ia[p->ci], p->ja[p->ci], p->ar[p->ci]);
-#endif
-#endif
mlp_create_problem_set_value (p, p->r_q[c], mlpi->c_b, mlpi->q_averaged[c], __LINE__);
- }
return GNUNET_OK;
for (c = 0; c < GNUNET_ATS_NetworkTypeCount; c++)
{
char * text;
- GNUNET_asprintf(&text, "quota_ats_%s", GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]));
+ GNUNET_asprintf(&text, "c10_quota_ats_%s", GNUNET_ATS_print_network_type(mlp->pv.quota_index[c]));
p->r_quota[c] = mlp_create_problem_create_constraint (p, text, GLP_DB, 0.0, mlp->pv.quota_out[c]);
GNUNET_free (text);
}
p->num_elements = (10 * p->num_addresses + mlp->pv.m_q * p->num_addresses + mlp->pv.m_q + p->num_peers + 2 + 1);
LOG (GNUNET_ERROR_TYPE_DEBUG, "Rebuilding problem for %u peer(s) and %u addresse(s) and %u quality metrics == %u elements\n",
p->num_peers, p->num_addresses, mlp->pv.m_q, p->num_elements);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Rebuilding %u \n", mlp->pv.b_min);
/* Set a problem name */
glp_set_prob_name (p->prob, "GNUnet ATS bandwidth distribution");
(unsigned long long) duration_lp.rel_value,
(unsigned long long) duration_mlp.rel_value);
+ /* Store LP */
+#if DUMP_PROBLEM
+ char *filename;
+ GNUNET_asprintf (&filename, "problem_%llu.lp", GNUNET_TIME_absolute_get().abs_value);
+ glp_write_lp (mlp->p.prob, 0, filename);
+ GNUNET_free (filename);
+#endif
+
/* Propagate result*/
if (GNUNET_OK == res)
{
}
/* Create address 3 */
- address[2] = create_address (&p[1], "test_plugin", "test_addr2", strlen("test_addr2")+1, 0);
+ address[2] = create_address (&p[1], "test_plugin2", "test_addr2", strlen("test_addr2")+1, 0);
if (NULL == address[2])
{
GNUNET_break (0);
/* Create address 0 */
- address[0] = create_address (&p[0], "test_plugin", "test_addr0", strlen("test_addr0")+1, 0);
+ address[0] = create_address (&p[0], "test_plugin0", "test_addr0", strlen("test_addr0")+1, 0);
if (NULL == address[0])
{
GNUNET_break (0);
GAS_mlp_get_preferred_address (mlp, addresses, &p[0]);
/* Create address 1 */
- address[1] = create_address (&p[0], "test_plugin", "test_addr1", strlen("test_addr1")+1, 0);
+ address[1] = create_address (&p[0], "test_plugin1", "test_addr1", strlen("test_addr1")+1, 0);
if (NULL == address[1])
{
GNUNET_break (0);