Fixed: Generics problems. Issue: Generics does not work right if 2 instances...

Fixed: Generics problems. Issue: Generics does not work right if 2 instances with the same name exist
parent f8017ca6
......@@ -153,7 +153,7 @@ public class GenerationTest extends AbstractSymtabTest {
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator();
String generationTargetPath = "./target/generated-sources-cmake/system/src/";
distributedTargetGenerator.setGenerationTargetPath(generationTargetPath);
// distributedTargetGenerator.setGenDebug(true);
distributedTargetGenerator.setGenDebug(true);
distributedTargetGenerator.add(new CPPGenImpl(),"cpp");
distributedTargetGenerator.add(new RosCppGenImpl(),"roscpp");
......@@ -233,30 +233,6 @@ public class GenerationTest extends AbstractSymtabTest {
content = content.replace("Col<int> counter=Col<int>(1);" , "Col<int> counter=Col<int>(n);");
content = content.replace("colvec tmpLine;","colvec tmpLine = colvec(4);");
// content = content.replace("sqrt","std::sqrt");
if(f.getName().equals("ba_system_collisionDetection_multiOr.h")){
content = content.replace("10","1");
}
// if(f.getName().equals("ba_system_collisionDetection_rectIntersection_1__dualSetCompare.h")){
// String fixedGenerics = "const int n = 4;\nconst int n2 = 10;\n";
// content = content.replace("const int cols = 1;","const int cols = 1;\n" + fixedGenerics);
// }
if(f.getName().equals("ba_system_collisionDetection_singleSetCompare.h")){
content = content.replace("const int n = 3","const int n = 2");
content = content.replace("const int x = 5","const int x = 1");
}
if(f.getName().equals("ba_system_collisionDetection_rectIntersection_1__dualSetCompare.h")){
content = content.replace("rows = 4","rows = 2");
content = content.replace("cols = 1","cols = 4");
// content = content.replace("n = 4","n = 2");
// content = content.replace("n2 = 10","n2 = 1");
}
Files.write(path, content.getBytes(charset));
}
......
......@@ -7,14 +7,14 @@ component CollisionDetection<N1 n = 2,N1 x = 1>{
ports in Rectangle hulls[n],
out B collision;
instance SingleSetCompareRectangle<2,1> singleSetCompare;
instance SingleSetCompareRectangle<2,1> singleSetCompareRect;
instance RectIntersection rectIntersection[x];
instance MultiOr<1> multiOr;
connect hulls[:] -> singleSetCompare.setIn[:];
connect hulls[:] -> singleSetCompareRect.setIn[:];
connect singleSetCompare.outA[:] -> rectIntersection[:].rect1;
connect singleSetCompare.outB[:] -> rectIntersection[:].rect2;
connect singleSetCompareRect.outA[:] -> rectIntersection[:].rect1;
connect singleSetCompareRect.outB[:] -> rectIntersection[:].rect2;
connect rectIntersection[:].collision -> multiOr.boolIn[:];
connect multiOr.boolOut -> collision;
}
\ No newline at end of file
......@@ -14,20 +14,20 @@ component RectIntersection{
//check intersection of 4*4 lines w/o permutations
//4*(4+1)/2 = 10 possibilities
instance DualSetCompareMatrix<2,4,4,10> dualSetCompare;
instance DualSetCompareMatrix<2,4,4,10> dualSetCompareLines;
instance LineIntersection lineIntersection[10];
instance MultiOr<10> multiOr;
instance MultiOr<10> multiOrRect;
connect rect1 -> rectToLines1.rect;
connect rect2 -> rectToLines2.rect;
connect rectToLines1.lines[:] -> dualSetCompare.setInA[:];
connect rectToLines2.lines[:] -> dualSetCompare.setInB[:];
connect rectToLines1.lines[:] -> dualSetCompareLines.setInA[:];
connect rectToLines2.lines[:] -> dualSetCompareLines.setInB[:];
connect dualSetCompare.outA[:] -> lineIntersection[:].lineA;
connect dualSetCompare.outB[:] -> lineIntersection[:].lineB;
connect dualSetCompareLines.outA[:] -> lineIntersection[:].lineA;
connect dualSetCompareLines.outB[:] -> lineIntersection[:].lineB;
connect lineIntersection[:].intersects -> multiOr.boolIn[:];
connect multiOr.boolOut -> collision;
connect lineIntersection[:].intersects -> multiOrRect.boolIn[:];
connect multiOrRect.boolOut -> collision;
}
\ No newline at end of file
package ba.tests;
import ba.util.*;
component SetCompareInstance{
instance SingleSetCompare<3,3,Q> singleSetCompareQ;
//instance SingleSetCompare<Q^{3,5},2,1> singleSetCompareMatGen;
instance SingleSetCompareMatrix<3,5,2,1> singleSetCompareMat;
instance DualSetCompare<3,6,Q> dualSetCompareQ;
//instance DualSetCompare<Q^{3,5},2,3> dualSetCompareMatGen;
instance DualSetCompareMatrix<4,1,2,3> dualSetCompareMat;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment