Aufgrund einer Wartung wird GitLab am 26.10. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 26.10. between 8:00 and 9:00 am.

TrajectoryCollision.emam 1.86 KB
Newer Older
1
2
3
4
5
6
package ba.intersection;
import ba.util.TrajectoryToLines;
import ba.util.LineIntersection;
import ba.util.DualSetCompareMatrix;

//TODO: m1 = m -1, m2 = m1(m1+1)/2
Alexander David Hellwig's avatar
Alexander David Hellwig committed
7
component TrajectoryCollision<N1 m = 10, N1 m1 = 9, N1 m2 = 45>{
8
9
10
    ports in Q^{3,m} trajectoryA,
          in Q^{3,m} trajectoryB,
          in Q cutoffTime,
Alexander David Hellwig's avatar
Alexander David Hellwig committed
11
12
          out B collision,
          out B aIsFasterOut;
13

Alexander David Hellwig's avatar
Alexander David Hellwig committed
14
15
16
    instance TrajectoryToLines<10,9> trajectoryToLinesA;
    instance TrajectoryToLines<10,9> trajectoryToLinesB;
    instance DualSetCompareMatrix<4,1,9,45> dualSetCompare;
17
    instance LineIntersection lineIntersection[m2];
Alexander David Hellwig's avatar
Alexander David Hellwig committed
18
    instance FirstLineIntersection<9,45> firstLineIntersection;
19
	//TODO: filter then get first 
Alexander David Hellwig's avatar
Alexander David Hellwig committed
20
    instance TimeCutoffFilter<10>(2.0) timeCutoffFilter;
21
22
23
24
25
26
27
28

    connect trajectoryA -> trajectoryToLinesA.trajectoryIn;
    connect trajectoryB -> trajectoryToLinesB.trajectoryIn;

    connect lineIntersection[:].intersects -> firstLineIntersection.collisionIn[:];
    connect lineIntersection[:].point -> firstLineIntersection.pointsIn[:];

    connect firstLineIntersection.collisionOut -> timeCutoffFilter.collisionIn;
Alexander David Hellwig's avatar
Alexander David Hellwig committed
29
30
    connect firstLineIntersection.lIndexA -> timeCutoffFilter.indexInA;
    connect firstLineIntersection.lIndexB -> timeCutoffFilter.indexInB;
31
32
33
34
35
    connect firstLineIntersection.pos -> timeCutoffFilter.colPosIn;
    connect trajectoryA -> timeCutoffFilter.trajectoryInA;
    connect trajectoryB -> timeCutoffFilter.trajectoryInB;
    connect cutoffTime -> timeCutoffFilter.timeCutoff;
    connect timeCutoffFilter.collisionOut -> collision;
Alexander David Hellwig's avatar
Alexander David Hellwig committed
36
    connect timeCutoffFilter.aIsFasterOut -> aIsFasterOut;
37
38
39
40
41
42

    connect trajectoryToLinesA.lineOut[:] -> dualSetCompare.setInA[:];
    connect trajectoryToLinesB.lineOut[:] -> dualSetCompare.setInB[:];

    connect dualSetCompare.outA[:] -> lineIntersection[:].lineA;
    connect dualSetCompare.outB[:] -> lineIntersection[:].lineB;
43
}