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

Model: changed holdTime and timeCutoff to adaptable parameters

parent 93ec824e
...@@ -27,7 +27,7 @@ component System{ ...@@ -27,7 +27,7 @@ component System{
instance IntersectionController intersectionController; instance IntersectionController intersectionController;
instance CollisionDetection collisionDetection; instance CollisionDetection collisionDetection;
instance CommQuality<B> stopCommQuality[2]; instance CommQuality<B> stopCommQuality[2];
instance VelocityController velocityController[2]; instance VelocityController(3.0) velocityController[2];
//Intersection //Intersection
package ba.intersection; package ba.intersection;
component TimeCutoffFilter{ component TimeCutoffFilter(adaptable Q timeCutoff){
ports in B collisionIn, ports in B collisionIn,
in Z IndexInA, in Z IndexInA,
in Z IndexInB, in Z IndexInB,
in Q^{2,1} colPosIn, in Q^{2,1} colPosIn,
in Q^{3,5} trajectoryInA, in Q^{3,5} trajectoryInA,
in Q^{3,5} trajectoryInB, in Q^{3,5} trajectoryInB,
in Q timeCutoff, //in Q timeCutoff,
out B collisionOut; out B collisionOut;
implementation Math{ implementation Math{
...@@ -15,7 +15,7 @@ component TrajectoryCollision<N1 m = 5, N1 m1 = 4, N1 m2 = 10>{ ...@@ -15,7 +15,7 @@ component TrajectoryCollision<N1 m = 5, N1 m1 = 4, N1 m2 = 10>{
instance DualSetCompareMatrix<4,1,m1,m2> dualSetCompare; instance DualSetCompareMatrix<4,1,m1,m2> dualSetCompare;
instance LineIntersection lineIntersection[m2]; instance LineIntersection lineIntersection[m2];
instance FirstLineIntersection firstLineIntersection; instance FirstLineIntersection firstLineIntersection;
instance TimeCutoffFilter timeCutoffFilter; instance TimeCutoffFilter(2.0) timeCutoffFilter;
connect trajectoryA -> trajectoryToLinesA.trajectoryIn; connect trajectoryA -> trajectoryToLinesA.trajectoryIn;
connect trajectoryB -> trajectoryToLinesB.trajectoryIn; connect trajectoryB -> trajectoryToLinesB.trajectoryIn;
package ba.vehicle; package ba.vehicle;
component VelocityController{ component VelocityController(adaptable Q holdTimeIn){
ports in Q maxVelIn, ports in Q maxVelIn,
in Q maxAccelIn, in Q maxAccelIn,
in Q deltaTimeIn, in Q deltaTimeIn,
in Q holdTimeIn, //in Q holdTimeIn,
in B slowDownIn, in B slowDownIn,
in B resetVelIn; in B resetVelIn;
...@@ -27,7 +27,7 @@ component VelocityController{ ...@@ -27,7 +27,7 @@ component VelocityController{
holdFor = holdFor - deltaTimeIn; holdFor = holdFor - deltaTimeIn;
if holdFor <= 0 if holdFor <= 0
//holdFor is either (-deltaTimeIn) //holdFor is either (-deltaTimeIn)
//or (- time since accel start) //or (- time since accel should start)
resVel = lastVel + maxAccelIn * (-holdFor); resVel = lastVel + maxAccelIn * (-holdFor);
holdFor = 0; holdFor = 0;
end end
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