Skip to content

Commit

Permalink
set a maximal bandwidth for a single connection (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-m committed Jun 18, 2012
1 parent 8dd07a0 commit 6fc5a04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
6 changes: 5 additions & 1 deletion src/constraint_generation.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ int generate_constraints(PSLProblem *problem, abstract_solver &solver, abstract_
solver.set_constraint_coeff(problem->rankZ(*i, *j, s), - min_bandwidth);
solver.add_constraint_geq(0);
///////////
//TODO maximal bandwidth for a single connection
//maximal bandwidth for a single connection
solver.new_constraint();
solver.set_constraint_coeff(problem->rankB(*i, *j, s), 1);
solver.set_constraint_coeff(problem->rankZ(*i, *j, s), - max_bandwidth);
solver.add_constraint_leq(0);
}
j++;
}
Expand Down
16 changes: 0 additions & 16 deletions src/constraint_generation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,10 @@
#include <combiner.h>




extern int new_var;
extern CUDFcoefficient min_bandwidth;
extern CUDFcoefficient max_bandwidth;

// available criteria
//#define CRIT_DEFAULT 1
//#define CRIT_CONSERVATIVE 2
//#define CRIT_FRESHER 3
//#define CRIT_SFRESHER 4
//#define CRIT_FFRESHER 5
//#define CRIT_TFRESHER 5
//#define CRIT_PARANOID 6
//#define CRIT_TRENDY 7
//#define CRIT_TRENDY2 8
//#define CRIT_LEXPARANOID 9
//#define CRIT_LEXTRENDY 10
//#define CRIT_LEXTRENDY2 11


// main function for constraint generation (translate a CUDF problem into MILP problem for a given solver and a given criteria)
extern int generate_constraints(PSLProblem *problem, abstract_solver &solver, abstract_combiner &combiner);
Expand Down

0 comments on commit 6fc5a04

Please sign in to comment.