Commit ff0dac3f authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Model: Reorder System

parent 59a1e679
......@@ -6,36 +6,40 @@ import ba.vehicle.VelocityController;
import ba.collisionDetection.CollisionDetection;
//component System<N1 n = 2,N1 x = 1,N1 m = 5,N1 m1 = 4,N1 m2 = 10>{
component System{
//Intersection
instance IntersectionController intersectionController;
ports in Q cutoffTimeIn,
//Intersection ports
ports in Q(0s : 10s) cutoffTimeIn,
in B isActiveIn,
in Q^{3,5} absTrajectory[2];
//Collision detection ports
ports in Q(0m : 10000000m)^{2,4} hullsIn[2],
out B collisionOut;
//Vehicle ports
ports in Q(0m/s^2 : 100m/s^2) maxAccel[2],
in Q(0m/s : 60m/s) maxVel[2],
in Q(0s : 10s) deltaTime[2],
in Q(0s : 60s) holdTime[2],
in B resetVel[2],
in B slowDown[2],
out Q(0m/s : 60m/s) curVel[2];
instance IntersectionController intersectionController;
instance CollisionDetection collisionDetection;
instance CommQuality<B> stopCommQuality[2];
instance VelocityController velocityController[2];
//Intersection
connect cutoffTimeIn -> intersectionController.cutoffTime;
connect isActiveIn -> intersectionController.isActive;
connect absTrajectory[:] -> intersectionController.trajectoryIn[:];
//Collision detection
instance CollisionDetection collisionDetection;
ports in Q^{2,4} hullsIn[2],
out B collisionOut;
connect hullsIn[:] -> collisionDetection.hulls[:];
connect collisionDetection.collision -> collisionOut;
//Vehicles
instance VelocityController velocityController[2];
ports in Q maxAccel[2],
in Q maxVel[2],
in Q deltaTime[2],
in Q holdTime[2],
in B resetVel[2],
in B slowDown[2],
out Q curVel[2];
connect maxAccel[:] -> velocityController[:].maxAccelIn;
connect maxVel[:] -> velocityController[:].maxVelIn;
connect deltaTime[:] -> velocityController[:].deltaTimeIn;
......@@ -43,11 +47,7 @@ component System{
connect resetVel[:] -> velocityController[:].resetVelIn;
connect velocityController[:].curVelOut -> curVel[:];
instance CommQuality<B> stopCommQuality[2];
//Communication Quality
connect intersectionController.stop[:] -> stopCommQuality[:].in1;
connect stopCommQuality[:].out1 -> velocityController[:].slowDownIn;
//connect intersectionController.stop[:] -> velocityController[:].slowDownIn;
}
\ 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