aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-03-30 14:17:47 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-03-30 14:17:47 +0000
commit02f95346373949f78389a83a81ae3b9f6c379187 (patch)
tree6a783e224866c6c7f36ce432bad28166146aea35 /src/transport
parentae8e9e180adc07317d15bbdd11fe6605f75dc889 (diff)
downloadgnunet-02f95346373949f78389a83a81ae3b9f6c379187.tar.gz
gnunet-02f95346373949f78389a83a81ae3b9f6c379187.zip
bound had wring direction...MLP now works as far as it is implemented
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index aee60294c..795cb0682 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -5574,8 +5574,8 @@ struct ATS_peer
5574 int t; 5574 int t;
5575}; 5575};
5576 5576
5577#define DEBUG_ATS GNUNET_NO 5577#define DEBUG_ATS GNUNET_YES
5578#define VERBOSE_ATS GNUNET_NO 5578#define VERBOSE_ATS GNUNET_YES
5579 5579
5580 5580
5581static int ats_create_problem (int max_it, int max_dur ) 5581static int ats_create_problem (int max_it, int max_dur )
@@ -5586,7 +5586,7 @@ static int ats_create_problem (int max_it, int max_dur )
5586#else 5586#else
5587 if (DEBUG_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "glpk installed\n"); 5587 if (DEBUG_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "glpk installed\n");
5588 5588
5589 5589#endif
5590 glp_prob *prob; 5590 glp_prob *prob;
5591 5591
5592 int c; 5592 int c;
@@ -5600,11 +5600,13 @@ static int ats_create_problem (int max_it, int max_dur )
5600 5600
5601 double v_b_min = 100; 5601 double v_b_min = 100;
5602 double v_n_min = 1; 5602 double v_n_min = 1;
5603 double M = 1000000000; 5603 double M = 109951162777600; // 100 TB
5604 5604
5605 // This are values that are later set from extern
5605 double D = 1; 5606 double D = 1;
5606 double U = 1; 5607 double U = 1;
5607 double R = 1; 5608 double R = 1;
5609
5608 double Q[c_q_metrics+1]; 5610 double Q[c_q_metrics+1];
5609 for (c=1; c<=c_q_metrics; c++) 5611 for (c=1; c<=c_q_metrics; c++)
5610 { 5612 {
@@ -5760,8 +5762,8 @@ static int ats_create_problem (int max_it, int max_dur )
5760 array_index++; 5762 array_index++;
5761 row_index ++; 5763 row_index ++;
5762 } 5764 }
5763 //GNUNET_assert (row_index-1==c_peers+c_mechs); 5765 GNUNET_assert (row_index-1==c_peers+c_mechs);
5764 //GNUNET_assert (array_index==c_mechs+(2*c_mechs)); 5766 GNUNET_assert (array_index-1==c_mechs+(2*c_mechs));
5765 5767
5766 /* Constraint 3: minimum bandwidth*/ 5768 /* Constraint 3: minimum bandwidth*/
5767 if (VERBOSE_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Constraint 3\n"); 5769 if (VERBOSE_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Constraint 3\n");
@@ -5770,7 +5772,7 @@ static int ats_create_problem (int max_it, int max_dur )
5770 { 5772 {
5771 /* b_t - n_t * b_min <= 0 */ 5773 /* b_t - n_t * b_min <= 0 */
5772 if (VERBOSE_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "bounds [row]=[%i] \n",row_index); 5774 if (VERBOSE_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "bounds [row]=[%i] \n",row_index);
5773 glp_set_row_bnds(prob, row_index, GLP_UP, 0.0, 0.0); 5775 glp_set_row_bnds(prob, row_index, GLP_LO, 0.0, 0.0);
5774 5776
5775 ia[array_index] = row_index; 5777 ia[array_index] = row_index;
5776 ja[array_index] = mechanisms[c].col_index; 5778 ja[array_index] = mechanisms[c].col_index;
@@ -5784,8 +5786,8 @@ static int ats_create_problem (int max_it, int max_dur )
5784 array_index++; 5786 array_index++;
5785 row_index ++; 5787 row_index ++;
5786 } 5788 }
5787 //GNUNET_assert (row_index-1==c_peers+(2*c_mechs)); 5789 GNUNET_assert (row_index-1==c_peers+(2*c_mechs));
5788 //GNUNET_assert (array_index==c_mechs+(4*c_mechs)); 5790 GNUNET_assert (array_index-1==c_mechs+(4*c_mechs));
5789 5791
5790 /* Constraint 4: max ressource capacity */ 5792 /* Constraint 4: max ressource capacity */
5791 /* 5793 /*
@@ -5829,8 +5831,8 @@ static int ats_create_problem (int max_it, int max_dur )
5829 array_index++; 5831 array_index++;
5830 } 5832 }
5831 row_index ++; 5833 row_index ++;
5832 //GNUNET_assert (row_index-1==c_peers+(2*c_mechs)+1); 5834 GNUNET_assert (row_index-1==c_peers+(2*c_mechs)+1);
5833 //GNUNET_assert (array_index==6*c_mechs); 5835 GNUNET_assert (array_index-1==6*c_mechs);
5834 5836
5835 /* optimisation constraints*/ 5837 /* optimisation constraints*/
5836 5838
@@ -5958,7 +5960,6 @@ static int ats_create_problem (int max_it, int max_dur )
5958 GNUNET_free(peers); 5960 GNUNET_free(peers);
5959 5961
5960 return c_mechs; 5962 return c_mechs;
5961#endif
5962} 5963}
5963 5964
5964/* To remove: just for testing */ 5965/* To remove: just for testing */