Skip to content

Commit

Permalink
fixing reverse parallel arcs
Browse files Browse the repository at this point in the history
  • Loading branch information
hhijazi committed Mar 13, 2018
1 parent ff400e7 commit 9768672
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/MINLP/Power/PowerNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,16 @@ int PowerNet::readgrid(const char* fname) {
string src,dest,key;
file >> word;
index = 0;
bool reversed = false;
while(word.compare("];")) {
src = word;
file >> dest;
key = dest+","+src;//Taking care of reversed direction arcs
reversed = false;
if(arcID.find(key)!=arcID.end()) {//Reverse arc direction
DebugOn("Adding arc linking " +src+" and "+dest);
DebugOn(" with reversed direction, reversing source and destination.\n");
reversed = true;
key = src;
src = dest;
dest = key;
Expand Down Expand Up @@ -438,6 +441,13 @@ int PowerNet::readgrid(const char* fname) {
arc->tbound.max = 60*pi/180;

}
if (reversed) {
arc->tr /= 1;
arc->as *= -1;
auto temp = arc->tbound.max;
arc->tbound.max = -1*arc->tbound.min;
arc->tbound.min = -1*temp;
}
// arc->tbound.max = 30*pi/180;
m_theta_ub += arc->tbound.max;

Expand Down

0 comments on commit 9768672

Please sign in to comment.