Commit 4e0259a9 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Modeling: after set compare

parent 33880925
package ba.intersection;
import ba.util.LineIntersection;
import ba.util.TrajectoryToLine;
import ba.util.MatrixSingleSetCompare;
//TODO: x = (n-1)n/2
component ConflictComputer<N1 n = 2,N1 x = 1,N1 m = 5>{
//TODO: m1 = m -1, m2 = m1(m1+1)/2
component ConflictComputer<N1 n = 2,N1 x = 1,N1 m = 5, N1 m1 = 4,N1 m2 = 10>{
port in Q^{3,m} trajectory[n];
port in Q cutoffTimeIn;
port out B conflictOut[x];
instance TrajectoryCompare trajectoryCompare;
instance CollisionToConflict collisionToConflict;
instance MatrixSingleSetCompare<3,m,2,x> singleSetCompare;
instance TrajectoryCompare<m,m1,m2> trajectoryCompare[x];
instance CollisionToConflict collisionToConflict[x];
connect trajectory[1] -> trajectoryCompare.trajectory[1];
connect trajectory[2] -> trajectoryCompare.trajectory[2];
connect trajectory[:] -> singleSetCompare.setIn[:];
connect singleSetCompare.listOut1[:] -> trajectoryCompare[:].trajectory1;
connect singleSetCompare.listOut2[:] -> trajectoryCompare[:].trajectory2;
connect trajectoryCompare[:].collision -> collisionToConflict[:].collisionIn;
connect singleSetCompare.listOut1[:] -> collisionToConflict[:].trajectoryIn1;
connect singleSetCompare.listOut2[:] -> collisionToConflict[:].trajectoryIn2;
connect cutoffTimeIn -> collisionToConflict[:].timeCutoff;
connect trajectory[1] -> collisionToConflict.trajectoryIn1;
connect trajectory[2] -> collisionToConflict.trajectoryIn2;
connect cutoffTimeIn -> collisionToConflict.timeCutoff;
connect trajectoryCompare[:].collision -> collisionToConflict[:].collisionIn;
connect trajectoryCompare[:].index1 -> collisionToConflict[:].indexIn1;
connect trajectoryCompare[:].index2 -> collisionToConflict[:].indexIn2;
connect trajectoryCompare[:].colPos -> collisionToConflict[:].colPosIn;
connect trajectoryCompare.collision -> collisionToConflict.collisionIn;
connect trajectoryCompare.index1 -> collisionToConflict.indexIn1;
connect trajectoryCompare.index2 -> collisionToConflict.indexIn2;
connect trajectoryCompare.colPos -> collisionToConflict.colPosIn;
connect collisionToConflict.conflict -> conflictOut[1];
connect collisionToConflict[:].conflict -> conflictOut[:];
}
......@@ -9,7 +9,7 @@ component IntersectionController{
port out B stop[2];
instance ConflictToStopLookup<2,1> conflictToStopLookup;
instance ConflictComputer<2,1,5> conflictComputer;
instance ConflictComputer<2,1,5,4,10> conflictComputer;
instance ConflictToStopConverter<2,1,5> conflictToStopConverter;
connect trajectoryIn[:] -> conflictComputer.trajectory[:];
......
package ba.intersection;
import ba.util.TrajectoryToLine;
import ba.util.LineIntersection;
import ba.util.MatrixDualSetCompare;
component TrajectoryCompare{
ports in Q^{3,5} trajectory[2],
//TODO: m1 = m -1, m2 = m1(m1+1)/2
component TrajectoryCompare<N1 m = 5, N1 m1 = 4, N1 m2 = 10>{
ports in Q^{3,m} trajectory1,
in Q^{3,m} trajectory2,
out B collision,
out Z index1,
out Z index2,
out Q^{2,1} colPos;
instance MatrixDualSetCompare<4,1,m1,m2> dualSetCompare;
instance TrajectoryToLine trajectoryToLine1;
instance TrajectoryToLine trajectoryToLine2;
instance LineIntersection lineIntersection[10];
instance LineIntersection lineIntersection[m2];
instance LineInterToIndex lineInterToIndex;
connect trajectory[1] -> trajectoryToLine1.trajectoryIn;
connect trajectory[2] -> trajectoryToLine2.trajectoryIn;
connect trajectory1 -> trajectoryToLine1.trajectoryIn;
connect trajectory2 -> trajectoryToLine2.trajectoryIn;
connect lineIntersection[:].intersects -> lineInterToIndex.collisionIn[:];
connect lineIntersection[:].point -> lineInterToIndex.pointsIn[:];
......@@ -29,38 +34,9 @@ component TrajectoryCompare{
//compare 4 lines to 4 other lines without permutations with same index
//4*5/2 = 10
connect trajectoryToLine1.lineOut[1] -> lineIntersection[1].line1;
connect trajectoryToLine2.lineOut[1] -> lineIntersection[1].line2;
connect trajectoryToLine1.lineOut[1] -> lineIntersection[2].line1;
connect trajectoryToLine2.lineOut[2] -> lineIntersection[2].line2;
connect trajectoryToLine1.lineOut[1] -> lineIntersection[3].line1;
connect trajectoryToLine2.lineOut[3] -> lineIntersection[3].line2;
connect trajectoryToLine1.lineOut[1] -> lineIntersection[4].line1;
connect trajectoryToLine2.lineOut[4] -> lineIntersection[4].line2;
connect trajectoryToLine1.lineOut[2] -> lineIntersection[5].line1;
connect trajectoryToLine2.lineOut[2] -> lineIntersection[5].line2;
connect trajectoryToLine1.lineOut[2] -> lineIntersection[6].line1;
connect trajectoryToLine2.lineOut[3] -> lineIntersection[6].line2;
connect trajectoryToLine1.lineOut[2] -> lineIntersection[7].line1;
connect trajectoryToLine2.lineOut[4] -> lineIntersection[7].line2;
connect trajectoryToLine1.lineOut[3] -> lineIntersection[8].line1;
connect trajectoryToLine2.lineOut[3] -> lineIntersection[8].line2;
connect trajectoryToLine1.lineOut[3] -> lineIntersection[9].line1;
connect trajectoryToLine2.lineOut[4] -> lineIntersection[9].line2;
connect trajectoryToLine1.lineOut[4] -> lineIntersection[10].line1;
connect trajectoryToLine2.lineOut[4] -> lineIntersection[10].line2;
//end line compare
connect trajectoryToLine1.lineOut[:] -> dualSetCompare.setIn1[:];
connect trajectoryToLine2.lineOut[:] -> dualSetCompare.setIn2[:];
connect dualSetCompare.listOut1[:] -> lineIntersection[:].line1;
connect dualSetCompare.listOut2[:] -> lineIntersection[:].line2;
}
\ 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