Commit 357f0746 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Model: flatten ConflictComputer

parent ff0dac3f
package ba.intersection;
import ba.util.LineIntersection;
import ba.util.TrajectoryToLine;
import ba.util.SingleSetCompareMatrix;
//TODO: x = (n-1)n/2
//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 SingleSetCompareMatrix<3,m,n,x> singleSetCompare;
instance TrajectoryCompare<m,m1,m2> trajectoryCompare[x];
connect trajectory[:] -> singleSetCompare.setIn[:];
connect singleSetCompare.listOut1[:] -> trajectoryCompare[:].trajectory1;
connect singleSetCompare.listOut2[:] -> trajectoryCompare[:].trajectory2;
connect cutoffTimeIn -> trajectoryCompare[:].cutoffTime;
connect trajectoryCompare[:].conflict -> conflictOut[:];
}
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>{
//component IntersectionController{
ports in Q^{3,m} trajectoryIn[n],
in Q cutoffTime,
in Q(0m : 10m) cutoffTime,
in B isActive,
out B stop[n];
instance ConflictComputer<n,x,m,m1,m2> conflictComputer;
instance SingleSetCompareMatrix<3,m,n,x> singleSetCompare;
instance TrajectoryCompare<m,m1,m2> trajectoryCompare[x];
instance ConflictToStopConverter<n,x,m> conflictToStopConverter;
connect trajectoryIn[:] -> conflictComputer.trajectory[:];
connect cutoffTime -> conflictComputer.cutoffTimeIn;
connect conflictComputer.conflictOut[:] -> conflictToStopConverter.conflictIn[:];
connect conflictToStopConverter.stopOut[:] -> stop[:];
connect trajectoryIn[:] -> singleSetCompare.setIn[:];
connect singleSetCompare.listOut1[:] -> trajectoryCompare[:].trajectory1;
connect singleSetCompare.listOut2[:] -> trajectoryCompare[:].trajectory2;
connect cutoffTime -> trajectoryCompare[:].cutoffTime;
connect trajectoryCompare[:].conflict -> conflictToStopConverter.conflictIn[:];
connect isActive -> conflictToStopConverter.active;
connect conflictToStopConverter.stopOut[:] -> stop[:];
}
\ 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