aboutsummaryrefslogtreecommitdiff
path: root/src/ats/perf_ats_solver.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-05-08 13:58:57 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-05-08 13:58:57 +0000
commit9013f22480d11d988a53daebfeeb4ea0d0b082cd (patch)
treef15a1e1c6b99d635178a50cc9463b109f9393db1 /src/ats/perf_ats_solver.c
parent96c662b7ea85239834a35aa8d132bc4ee42afffd (diff)
downloadgnunet-9013f22480d11d988a53daebfeeb4ea0d0b082cd.tar.gz
gnunet-9013f22480d11d988a53daebfeeb4ea0d0b082cd.zip
fixing network generation issue with mlp evalution tool
Diffstat (limited to 'src/ats/perf_ats_solver.c')
-rw-r--r--src/ats/perf_ats_solver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index 7d29e4b64..025fab721 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -1428,7 +1428,13 @@ perf_run_iteration (void)
1428 { 1428 {
1429 cur_addr = perf_create_address (cp, ca); 1429 cur_addr = perf_create_address (cp, ca);
1430 /* Add address */ 1430 /* Add address */
1431 ph.env.sf.s_add (ph.solver, cur_addr, GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ATS_NetworkTypeCount)); 1431 uint32_t net = 1 + GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ATS_NetworkTypeCount - 1);
1432 cur_addr->atsi = GNUNET_new (struct GNUNET_ATS_Information);
1433 cur_addr->atsi_count = 1;
1434 cur_addr->atsi[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
1435 cur_addr->atsi[0].value = htonl (net);
1436 ph.env.sf.s_add (ph.solver, cur_addr, net);
1437
1432 ph.current_a = ca + 1; 1438 ph.current_a = ca + 1;
1433 perf_address_initial_update (ph.solver, ph.addresses, cur_addr); 1439 perf_address_initial_update (ph.solver, ph.addresses, cur_addr);
1434 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 1440 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
@@ -1496,7 +1502,8 @@ perf_run_iteration (void)
1496 ph.env.sf.s_del (ph.solver, cur, GNUNET_NO); 1502 ph.env.sf.s_del (ph.solver, cur, GNUNET_NO);
1497 next = cur->next; 1503 next = cur->next;
1498 GNUNET_CONTAINER_DLL_remove(ph.peers[cp].head, ph.peers[cp].tail, cur); 1504 GNUNET_CONTAINER_DLL_remove(ph.peers[cp].head, ph.peers[cp].tail, cur);
1499 GNUNET_free(cur); 1505 GNUNET_free_non_null (cur->atsi);
1506 GNUNET_free (cur);
1500 } 1507 }
1501 } 1508 }
1502 1509