Skip to content

Commit 1761dd0

Browse files
author
Jens Frenkel
committed
- bugfix rooted
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12352 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 6dcf767 commit 1761dd0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Compiler/FrontEnd/ConnectionGraph.mo

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ algorithm
11551155
HashTable.HashTable rooted;
11561156
list<DAE.ComponentRef> rest,level,next;
11571157
DAE.ComponentRef cr;
1158+
Integer i;
11581159
case({},_,_,{},_) then irooted;
11591160
case({},_,_,_,_)
11601161
then
@@ -1170,7 +1171,7 @@ algorithm
11701171
// stringDelimitList(List.map(next,ComponentReference.printComponentRefStr),"\n") +& " to the queue\n");
11711172
next = listAppend(nextLevel,next);
11721173
then
1173-
setRootDistance(nextLevel,table,distance,next,irooted);
1174+
setRootDistance(rest,table,distance,next,rooted);
11741175
case(cr::rest,_,_,_,_)
11751176
equation
11761177
failure(_ = BaseHashTable.get(cr, irooted));
@@ -1179,6 +1180,14 @@ algorithm
11791180
// ComponentReference.printComponentRefStr(cr) +& " , " +& intString(distance) +& "\n");
11801181
then
11811182
setRootDistance(rest,table,distance,nextLevel,rooted);
1183+
/* case(cr::rest,_,_,_,_)
1184+
equation
1185+
i = BaseHashTable.get(cr, irooted);
1186+
print("- ConnectionGraph.setRootDistance: found " +&
1187+
ComponentReference.printComponentRefStr(cr) +& " twice, value is " +& intString(i) +& "\n");
1188+
then
1189+
setRootDistance(rest,table,distance,nextLevel,irooted);
1190+
*/
11821191
case(cr::rest,_,_,_,_)
11831192
//equation
11841193
// print("- ConnectionGraph.setRootDistance: cannot found " +& ComponentReference.printComponentRefStr(cr) +& "\n");
@@ -1261,6 +1270,7 @@ algorithm
12611270
connections = getConnections(graph);
12621271
table = List.fold(connections,addConnectionsRooted,table);
12631272
// get distanste to root
1273+
// print("Roots: " +& stringDelimitList(List.map(inRoots,ComponentReference.printComponentRefStr),"\n") +& "\n");
12641274
// BaseHashTable.dumpHashTable(table);
12651275
rooted = setRootDistance(inRoots,table,0,{},HashTable.emptyHashTable());
12661276
// BaseHashTable.dumpHashTable(rooted);
@@ -1320,7 +1330,7 @@ algorithm
13201330
case(_,_,_)
13211331
equation
13221332
i1 = BaseHashTable.get(cref1,rooted);
1323-
i2 = BaseHashTable.get(cref1,rooted);
1333+
i2 = BaseHashTable.get(cref2,rooted);
13241334
then
13251335
intLt(i1,i2);
13261336
// in faile case return true

0 commit comments

Comments
 (0)