Skip to content

Commit a6141f5

Browse files
James CraigJames Craig
authored andcommitted
v518 - fixed near-sill infeasibility problem in management
removed binary variable treatment of stage-discharge constraint - greatly simplifies problem - no more need for branch + bound [BACKWARD COMPATIBILITY] - management models now have maximum penalty of 1,000,000
1 parent 3529bda commit a6141f5

File tree

4 files changed

+105
-179
lines changed

4 files changed

+105
-179
lines changed

src/DemandExpressionHandling.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,20 +1334,27 @@ void CDemandOptimizer::AddConstraintToLP(const int ii, const int kk, lp_lib::lpr
13341334
return;
13351335
}
13361336

1337+
//bool is_stage;
1338+
//double h_min;
13371339
RHS=0.0;
13381340
for (int j = 0; j < pE->nGroups; j++)
13391341
{
13401342
coeff=1.0;
13411343
group_has_dv=false;
13421344
DV_ind=DOESNT_EXIST;
1343-
1345+
//is_stage=false;
13441346
for (int k = 0; k < pE->nTermsPerGrp[j]; k++)
13451347
{
13461348
if (pE->pTerms[j][k]->type == TERM_DV)
13471349
{
13481350
DV_ind=pE->pTerms[j][k]->DV_ind;
13491351
group_has_dv=true;
13501352
coeff *= (pE->pTerms[j][k]->mult);
1353+
1354+
//is_stage= ((pE->pTerms[j][k]->origexp[0]=='!') && (pE->pTerms[j][k]->origexp[1] == 'h'));
1355+
//if (is_stage){
1356+
// h_min=_pModel->GetSubBasin(pE->pTerms[j][k]->p_index)->GetReservoir()->GetDryStage();
1357+
//}
13511358
}
13521359
else if (!(pE->pTerms[j][k]->is_nested))
13531360
{
@@ -1362,6 +1369,7 @@ void CDemandOptimizer::AddConstraintToLP(const int ii, const int kk, lp_lib::lpr
13621369
else {
13631370
coeff *= (pE->pTerms[j][k]->mult) * term;
13641371
}
1372+
13651373
}
13661374
}
13671375

@@ -1372,6 +1380,9 @@ void CDemandOptimizer::AddConstraintToLP(const int ii, const int kk, lp_lib::lpr
13721380
col_ind[i]=DV_ind;
13731381
row_val[i]=coeff;
13741382
i++;
1383+
//if (is_stage) {
1384+
// RHS-=coeff*h_min;
1385+
//}
13751386
}
13761387
}
13771388
}

0 commit comments

Comments
 (0)