gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14967 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r14967 - gnunet/src/transport
Date: Tue, 12 Apr 2011 18:20:32 +0200

Author: wachs
Date: 2011-04-12 18:20:32 +0200 (Tue, 12 Apr 2011)
New Revision: 14967

Modified:
   gnunet/src/transport/gnunet-service-transport.c
Log:
finished: rebuilding problem only when peers (dis)connect
starting: modififying matrix when qm and cr changes



Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2011-04-12 15:05:19 UTC 
(rev 14966)
+++ gnunet/src/transport/gnunet-service-transport.c     2011-04-12 16:20:32 UTC 
(rev 14967)
@@ -879,6 +879,13 @@
 {
        int c_mechs;
        int c_peers;
+
+       int begin_qm;
+       int end_qm;
+
+       int begin_cr;
+       int end_cr;
+
        int solution;
        int valid;
 };
@@ -5883,7 +5890,7 @@
 
        // Solving simplex
        glp_prob *prob = ats->prob;
-       /*
+
        glp_smcp opt_lp;
        glp_init_smcp(&opt_lp);
 #if VERBOSE_ATS
@@ -5891,17 +5898,17 @@
 #else
        opt_lp.msg_lev = GLP_MSG_OFF;
 #endif
-       opt_lp.presolve = GLP_ON;
+       //opt_lp.presolve = GLP_ON;
        result = glp_simplex(prob, &opt_lp);
        solution =  glp_get_status (prob);
 
        if (GNUNET_YES == ats_evaluate_results(result, solution, "LP"))
-       {*/
+       {
                /* Solving mlp */
                glp_iocp opt_mlp;
                glp_init_iocp(&opt_mlp);
                /* maximum duration */
-               opt_mlp.presolve = GLP_ON;
+               //opt_mlp.presolve = GLP_ON;
                opt_mlp.tm_lim = max_dur;
                /* output level */
 #if VERBOSE_ATS
@@ -5916,14 +5923,14 @@
                if (ats_evaluate_results(result, solution, "MLP") == GNUNET_YES)
                        res->valid = GNUNET_YES;
        /* done */
-       //}
+       }
 
        if ((ats->save_mlp == GNUNET_YES) && (c_peers > 1))
        {
                char * filename;
-               GNUNET_asprintf (&filename, "ats_mlp_p%i_m%i_llu.mlp",c_peers, 
c_mechs, GNUNET_TIME_absolute_get().abs_value);
+               GNUNET_asprintf (&filename, "ats_mlp_p%i_m%i_%llu.mlp",c_peers, 
c_mechs, GNUNET_TIME_absolute_get().abs_value);
                if (GNUNET_NO == GNUNET_DISK_file_test(filename))
-                       glp_write_mip (prob, filename);
+                       glp_write_lp (prob, NULL, filename);
                GNUNET_free (filename);
        }
        if ((ats->save_solution == GNUNET_YES) && (c_peers > 1))
@@ -6205,12 +6212,14 @@
        }
        int c2;
        /* Constraint 4: max ressource capacity */
-       /* V cr: bt * ct_r <= cr_maxsolution
+       /* V cr: bt * ct_r <= cr_max
         * */
        glp_add_rows(ats->prob, available_ressources);
        double ct_max = VERY_BIG_DOUBLE_VALUE;
        double ct_min = 0.0;
 
+       res->begin_cr = array_index;
+
        for (c=0; c<available_ressources; c++)
        {
                ct_max = ressources[c].c_max;
@@ -6234,6 +6243,7 @@
                }
                row_index ++;
        }
+       res->end_cr = array_index--;
 
        /* Constraint 5: min number of connections*/
        glp_add_rows(ats->prob, 1);
@@ -6308,6 +6318,7 @@
 
        // Constraint 7: optimize for quality
     glp_add_rows(ats->prob, available_quality_metrics);
+       res->begin_qm = array_index;
        for (c=1; c <= c_q_metrics; c++)
        {
 #if VERBOSE_ATS
@@ -6362,6 +6373,7 @@
                array_index++;
                row_index++;
        }
+       res->end_qm = array_index--;
 
        // Constraint 8: optimize bandwidth utility
        glp_add_rows(ats->prob, 1);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]