Model: Refactoring

parent 16fe64ed
......@@ -3,7 +3,7 @@ import ba.intersection.IntersectionController;
import ba.util.RelToAbsTrajectory;
import ba.util.CommQuality;
import ba.vehicle.VelocityController;
import ba.collisionDetection.CollisionDetectionGeneric;
import ba.collision.CollisionDetection;
import ba.struct.Rectangle;
//component System<N1 n = 2,N1 x = 1,N1 m = 5,N1 m1 = 4,N1 m2 = 10>{
component System{
......@@ -26,7 +26,7 @@ component System{
out Q(0m/s : 60m/s) curVel[2];
instance IntersectionController intersectionController;
instance CollisionDetectionGeneric collisionDetection;
instance CollisionDetection collisionDetection;
instance CommQuality<B> stopCommQuality[2];
instance VelocityController(3.0) velocityController[2];
......
package ba.collisionDetection;
import ba.util.RectIntersection;
import ba.util.SingleSetCompareRectangle;
package ba.collision;
import ba.util.MultiOr;
import ba.util.SingleSetCompareRectangle;
import ba.struct.Rectangle;
component CollisionDetectionGeneric<N1 n = 2,N1 x = 1>{
component CollisionDetection<N1 n = 2,N1 x = 1>{
//component CollisionDetection{
ports in Rectangle hulls[n],
out B collision;
......
package ba.util;
package ba.collision;
import ba.struct.Point;
component PointsToLine{
......
package ba.util;
package ba.collision;
import ba.util.DualSetCompareMatrix;
import ba.util.LineIntersection;
import ba.util.MultiOr;
import ba.struct.Rectangle;
component RectIntersection{
......
package ba.util;
package ba.collision;
import ba.struct.Rectangle;
import ba.struct.RectToPoints;
......@@ -23,5 +23,4 @@ component RectToLines{
connect rectToPoints.points[1] -> pointsToLine[4].pointB;
connect pointsToLine[:].line -> lines[:];
}
\ No newline at end of file
package ba.collisionDetection;
import ba.util.RectIntersection;
//TODO: as generic
component CollisionDetection{
ports in Q^{2,4} hulls[2],
out B collision;
instance RectIntersection rectIntersection;
connect hulls[1] -> rectIntersection.rect1;
connect hulls[2] -> rectIntersection.rect2;
connect rectIntersection.collision -> collision;
}
\ 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