71 #define infinity 1e+20 77 {
"Anderlues", 0.0, 1.2, 0.0, 66.2, 0.0 },
78 {
"Antwerpen", -
infinity, -4.034, 30.0, 80.0, 0.0 },
79 {
"Arlon", -
infinity, -0.222, 0.0, 66.2, 0.0 },
80 {
"Berneau", 0.0, 0.0, 0.0, 66.2, 0.0 },
81 {
"Blaregnies", -
infinity, -15.616, 50.0, 66.2, 0.0 },
82 {
"Brugge", -
infinity, -3.918, 30.0, 80.0, 0.0 },
83 {
"Dudzele", 0.0, 8.4, 0.0, 77.0, 2.28 },
84 {
"Gent", -
infinity, -5.256, 30.0, 80.0, 0.0 },
85 {
"Liege", -
infinity, -6.385, 30.0, 66.2, 0.0 },
86 {
"Loenhout", 0.0, 4.8, 0.0, 77.0, 2.28 },
87 {
"Mons", -
infinity, -6.848, 0.0, 66.2, 0.0 },
88 {
"Namur", -
infinity, -2.120, 0.0, 66.2, 0.0 },
89 {
"Petange", -
infinity, -1.919, 25.0, 66.2, 0.0 },
90 {
"Peronnes", 0.0, 0.96, 0.0, 66.2, 1.68 },
91 {
"Sinsin", 0.0, 0.0, 0.0, 63.0, 0.0 },
92 {
"Voeren", 20.344, 22.012, 50.0, 66.2, 1.68 },
93 {
"Wanze", 0.0, 0.0, 0.0, 66.2, 0.0 },
94 {
"Warnand", 0.0, 0.0, 0.0, 66.2, 0.0 },
95 {
"Zeebrugge", 8.87, 11.594, 0.0, 77.0, 2.28 },
96 {
"Zomergem", 0.0, 0.0, 0.0, 80.0, 0.0 }
103 { 18, 6, 890.0, 4.0,
FALSE },
104 { 18, 6, 890.0, 4.0,
FALSE },
105 { 6, 5, 890.0, 6.0,
FALSE },
106 { 6, 5, 890.0, 6.0,
FALSE },
107 { 5, 19, 890.0, 26.0,
FALSE },
108 { 9, 1, 590.1, 43.0,
FALSE },
109 { 1, 7, 590.1, 29.0,
FALSE },
110 { 7, 19, 590.1, 19.0,
FALSE },
111 { 19, 13, 890.0, 55.0,
FALSE },
112 { 15, 3, 890.0, 5.0,
TRUE },
113 { 15, 3, 395.0, 5.0,
TRUE },
114 { 3, 8, 890.0, 20.0,
FALSE },
115 { 3, 8, 395.0, 20.0,
FALSE },
116 { 8, 17, 890.0, 25.0,
FALSE },
117 { 8, 17, 395.0, 25.0,
FALSE },
118 { 17, 11, 890.0, 42.0,
FALSE },
119 { 11, 0, 890.0, 40.0,
FALSE },
120 { 0, 13, 890.0, 5.0,
FALSE },
121 { 13, 10, 890.0, 10.0,
FALSE },
122 { 10, 4, 890.0, 25.0,
FALSE },
123 { 17, 16, 395.5, 10.5,
FALSE },
124 { 16, 14, 315.5, 26.0,
TRUE },
125 { 14, 2, 315.5, 98.0,
FALSE },
126 { 2, 12, 315.5, 6.0,
FALSE }
166 for( i = 0; i <
narcs; ++i )
175 for( i = 0; i <
narcs; ++i )
177 (void)
SCIPsnprintf(name,
SCIP_MAXSTRLEN,
"pressurediff_%s_%s", nodedata[arcdata[i].node1].name, nodedata[arcdata[i].node2].name);
184 for( i = 0; i <
nnodes; ++i )
196 for( i = 0; i <
nnodes; ++i )
209 for( i = 0; i <
nnodes; ++i )
218 for( j = 0; j <
narcs; ++j )
221 if( arcdata[j].node1 == i )
227 if( arcdata[j].node2 == i )
239 for( i = 0; i <
narcs; ++i )
244 assert(pressurediff[i] !=
NULL);
245 assert(arcdata[i].node1 >= 0 && arcdata[i].node1 < nnodes);
246 assert(arcdata[i].node2 >= 0 && arcdata[i].node2 < nnodes);
247 assert(pressure[arcdata[i].node1] !=
NULL);
248 assert(pressure[arcdata[i].node2] !=
NULL);
250 vars[0] = pressurediff[i];
251 vars[1] = pressure[arcdata[i].
node1];
252 vars[2] = pressure[arcdata[i].node2];
254 (void)
SCIPsnprintf(name,
SCIP_MAXSTRLEN,
"pressurediff_%s_%s", nodedata[arcdata[i].node1].name, nodedata[arcdata[i].node2].name);
266 for( i = 0; i <
narcs; ++i )
270 (void)
SCIPsnprintf(name,
SCIP_MAXSTRLEN,
"pressureloss_%s_%s", nodedata[arcdata[i].node1].name, nodedata[arcdata[i].node2].name);
272 coef = 96.074830e-15 *
pow(arcdata[i].diameter, 5.0) *
pow(2.0*log10(3.7*arcdata[i].diameter /
rugosity), 2.0)
291 for( i = 0; i <
nnodes; ++i )
299 for( i = 0; i <
narcs; ++i )
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
SCIPInterval pow(const SCIPInterval &x, const SCIPInterval &y)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
static SCIP_RETCODE runGastrans(void)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
static const SCIP_Real gastemp
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
static GRAPHNODE ** active
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
SCIP_RETCODE SCIPcreateConsBasicAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
static const NodeData nodedata[]
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
static const SCIP_Real rugosity
SCIP_RETCODE SCIPpresolve(SCIP *scip)
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
static const ArcData arcdata[]
static SCIP_RETCODE setupProblem(SCIP *scip)
static const SCIP_Real density
int main(int argc, char **argv)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
void SCIPprintError(SCIP_RETCODE retcode)
SCIP_RETCODE SCIPfree(SCIP **scip)
static const SCIP_Real compressibility