Commit 1904ddf7 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Model: m = 5 -> 10

parent ba9f8c1a
......@@ -10,7 +10,7 @@ component System{
//Intersection ports
in Q(0s : 10s) cutoffTimeIn,
in B isActiveIn,
in Q^{3,5} absTrajectory[2],
in Q^{3,10} absTrajectory[2],
//Collision detection ports
in Rectangle hullsIn[2],
out B collisionOut,
......@@ -23,7 +23,7 @@ component System{
in B slowDown[2],
out Q(0m/s : 60m/s) curVel[2];
instance IntersectionController<2,1,5,4,10> intersectionController;
instance IntersectionController<2,1,10,4,10> intersectionController;
instance CollisionDetection<2,1> collisionDetection;
instance CommQuality<B> stopCommQuality[2];
instance VelocityController(3.0) velocityController[2];
......
package ba.intersection;
//TODO: x = (n-1)n/2
component CollisionToStop<N1 n = 2,N1 x = 1,N1 m = 5>{
component CollisionToStop<N1 n = 2,N1 x = 1,N1 m = 10>{
port in B collisionIn[x];
port in B active;
port out B stopOut[n];
......
package ba.intersection;
//Finds the earliest line intersection from a set of LineIntersection components
component FirstLineIntersection<N1 m1 = 4, N1 m2 = 10>{
component FirstLineIntersection<N1 m1 = 9, N1 m2 = 45>{
ports in B collisionIn[m2],
in Q^{2,1} pointsIn[m2],
......
......@@ -2,15 +2,15 @@ package ba.intersection;
import ba.util.SingleSetCompareMatrix;
//TODO: x = (n-1)n/2
//TODO: m1 = m - 1, m2 = m1(m1+1)/2
component IntersectionController<N1 n = 2,N1 x = 1,N1 m = 5,N1 m1 = 4,N1 m2 = 10>{
ports in Q^{3,5} trajectoryIn[n],
component IntersectionController<N1 n = 2,N1 x = 1,N1 m = 10,N1 m1 = 9,N1 m2 = 45>{
ports in Q^{3,10} trajectoryIn[n],
in Q(0m : 10m) cutoffTime,
in B isActive,
out B stop[n];
instance SingleSetCompareMatrix<3,5,2,1> singleSetCompare;
instance TrajectoryCollision<5,4,10> trajectoryCollision[x];
instance CollisionToStop<2,1,5> collisionToStop;
instance SingleSetCompareMatrix<3,10,2,1> singleSetCompare;
instance TrajectoryCollision<10,9,45> trajectoryCollision[x];
instance CollisionToStop<2,1,10> collisionToStop;
connect trajectoryIn[:] -> singleSetCompare.setIn[:];
connect singleSetCompare.outA[:] -> trajectoryCollision[:].trajectoryA;
......
package ba.intersection;
component TimeCutoffFilter<N1 m = 5>(adaptable Q timeCutoff){
component TimeCutoffFilter<N1 m = 10>(adaptable Q timeCutoff){
ports in B collisionIn,
in Z indexInA,
in Z indexInB,
......
......@@ -4,18 +4,18 @@ import ba.util.LineIntersection;
import ba.util.DualSetCompareMatrix;
//TODO: m1 = m -1, m2 = m1(m1+1)/2
component TrajectoryCollision<N1 m = 5, N1 m1 = 4, N1 m2 = 10>{
component TrajectoryCollision<N1 m = 10, N1 m1 = 9, N1 m2 = 45>{
ports in Q^{3,m} trajectoryA,
in Q^{3,m} trajectoryB,
in Q cutoffTime,
out B collision;
instance TrajectoryToLines trajectoryToLinesA;
instance TrajectoryToLines trajectoryToLinesB;
instance DualSetCompareMatrix<4,1,4,10> dualSetCompare;
instance TrajectoryToLines<10,9> trajectoryToLinesA;
instance TrajectoryToLines<10,9> trajectoryToLinesB;
instance DualSetCompareMatrix<4,1,9,45> dualSetCompare;
instance LineIntersection lineIntersection[m2];
instance FirstLineIntersection<4,10> firstLineIntersection;
instance TimeCutoffFilter<5>(2.0) timeCutoffFilter;
instance FirstLineIntersection<9,45> firstLineIntersection;
instance TimeCutoffFilter<10>(2.0) timeCutoffFilter;
connect trajectoryA -> trajectoryToLinesA.trajectoryIn;
connect trajectoryB -> trajectoryToLinesB.trajectoryIn;
......
......@@ -2,7 +2,7 @@ package ba.util;
//TODO: n2 = n(n+1)/2
//TODO: EMAM2Cpp does not work with matrix generics
//TODO: EMAM2Cpp does not work when T is first generic, n and n2 are not present in generated code
component DualSetCompare<N1 n = 5, N2 n2 = 15,T>{
component DualSetCompare<N1 n = 10, N2 n2 = 15,T>{
ports in T setInA[n],
in T setInB[n],
out T outA[n2],
......
package ba.util;
//TODO: n2 = n(n+1)/2
//TODO: remove once EMAM2CPP supports matrix generics
component DualSetCompareMatrix<N1 rows = 4,N1 cols = 1,N1 n = 4, N2 n2 = 10>{
component DualSetCompareMatrix<N1 rows = 4,N1 cols = 1,N1 n = 10, N2 n2 = 55>{
ports in Q^{rows,cols} setInA[n],
in Q^{rows,cols} setInB[n],
out Q^{rows,cols} outA[n2],
......
package ba.util;
//TODO: x has to be (n-1)n/2
//TODO: remove once EMAM2Cpp works with matrix generics
component SingleSetCompareMatrix<N1 rows = 3,N1 cols = 5, N1 n = 2,N1 x = 1>{
component SingleSetCompareMatrix<N1 rows = 3,N1 cols = 10, N1 n = 2,N1 x = 1>{
ports in Q^{rows,cols} setIn[n],
out Q^{rows,cols} outA[x],
out Q^{rows,cols} outB[x];
......
package ba.util;
component TrajectoryToLines{
ports in Q^{3,5} trajectoryIn,
component TrajectoryToLines<N1 m = 10, N1 m1 = 9>{
ports in Q^{3,m} trajectoryIn,
//m-1 lineOuts
out Q^{4,1} lineOut[4];
out Q^{4,1} lineOut[m1];
implementation Math{
for i = 1:4
for i = 1:m1
Q^{4,1} tmpLine;
tmpLine(1,1) = trajectoryIn(1,i);
tmpLine(2,1) = trajectoryIn(2,i);
......
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