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