#define DEBUG_ATS GNUNET_NO
#define VERBOSE_GLPK GNUNET_NO
+#define ENABLE_C8 GNUNET_YES
+#define ENABLE_C9 GNUNET_YES
/**
* Translate glpk solver error codes to text
* @param retcode return code
glp_set_row_bnds (mlp->prob, peer->r_c2, GLP_FX, 1.0, 1.0);
/* Adding rows for c 9) */
+#if ENABLE_C9
peer->r_c9 = glp_add_rows (mlp->prob, 1);
GNUNET_asprintf(&name, "c9_%s", GNUNET_i2s(&peer->id));
glp_set_row_name (mlp->prob, peer->r_c9, name);
ja[mlp->ci] = mlp->c_r;
ar[mlp->ci] = -1;
mlp->ci++;
-
-
+#endif
while (addr != NULL)
{
ar[mlp->ci] = peer->f;
mlp->ci++;
+#if ENABLE_C9
/* coefficient for c 9) */
ia[mlp->ci] = peer->r_c9;
ja[mlp->ci] = mlpi->c_b;
ar[mlp->ci] = 1;
mlp->ci++;
+#endif
addr = addr->next;
}
/* Column lower bound = 0.0 */
glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0);
+#if ENABLE_C9
/* Relativity r column */
col = glp_add_cols (mlp->prob, 1);
mlp->c_r = col;
glp_set_obj_coef (mlp->prob, col, mlp->co_R);
/* Column lower bound = 0.0 */
glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0);
+#endif
/* Quality metric columns */
col = glp_add_cols(mlp->prob, mlp->m_q);
mlp->prob = glp_create_prob();
GNUNET_assert (mlp->prob != NULL);
+ mlp->BIG_M = (double) (UINT32_MAX) /10;
+
/* Get diversity coefficient from configuration */
if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_size (cfg, "ats",
"COEFFICIENT_D",
if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_size (cfg, "ats", entry_out, "a_out))
{
- quota_out = UINT32_MAX;
+ quota_out = mlp->BIG_M;
}
if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_size (cfg, "ats", entry_in, "a_in))
{
- quota_in = UINT32_MAX;
+ quota_in = mlp->BIG_M;
}
/* Check if defined quota could make problem unsolvable */
if ((n_min * b_min) > quota_out)
mlp->last_execution = GNUNET_TIME_absolute_get_forever();
-
- mlp->BIG_M = (double) UINT32_MAX;
mlp->co_D = D;
mlp->co_R = R;
mlp->co_U = U;
addr[0].peer.hashPubKey = p[0].hashPubKey;
struct GNUNET_ATS_Information a1_ats[3];
set_ats (&a1_ats[0], GNUNET_ATS_QUALITY_NET_DISTANCE, 1);
- set_ats (&a1_ats[1], GNUNET_ATS_QUALITY_NET_DELAY, 32);
+ set_ats (&a1_ats[1], GNUNET_ATS_QUALITY_NET_DELAY, 2);
set_ats (&a1_ats[2], GNUNET_ATS_ARRAY_TERMINATOR, 0);
create_address (&addr[0], "dummy", 3, &a1_ats[0]);
- addr[0].atsp_network_type = GNUNET_ATS_NET_WAN;
+ addr[0].atsp_network_type = GNUNET_ATS_NET_LOOPBACK;
/* Creating peer 1 address 2 */
set_ats (&a2_ats[1], GNUNET_ATS_QUALITY_NET_DISTANCE, 1);
set_ats (&a2_ats[2], GNUNET_ATS_ARRAY_TERMINATOR, 0);
create_address (&addr[1], "dummy2", 3, &a2_ats[0]);
- addr[1].atsp_network_type = GNUNET_ATS_NET_WAN;
+ addr[1].atsp_network_type = GNUNET_ATS_NET_LAN;
/* Creating peer 2 address 1 */
addr[2].peer.hashPubKey = p[1].hashPubKey;
set_ats (&a3_ats[1], GNUNET_ATS_QUALITY_NET_DISTANCE, 1);
set_ats (&a3_ats[2], GNUNET_ATS_ARRAY_TERMINATOR, 0);
create_address (&addr[2], "dummy3", 3, &a3_ats[0]);
- addr[2].atsp_network_type = GNUNET_ATS_NET_LAN;
+ addr[2].atsp_network_type = GNUNET_ATS_NET_WAN;
GNUNET_CONTAINER_multihashmap_put(addresses, &addr[0].peer.hashPubKey, &addr[0], GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);