Unverified Commit 7352844f authored by Michael von Wenckstern's avatar Michael von Wenckstern Committed by GitHub
Browse files

Update Constant_velocity.emam

parent 03690a43
......@@ -5,7 +5,7 @@ import montiarc.atomic.*;
component Constant_velocity {
port
in (0km/h : 250km/h) velocity,
in (-oo:oo) time,
in (-oo:oo) time, // this is shit!, it must be (0s:1ms:00 s)
out (-2m/s^2:2m/s^2) acceleration,
out (-180°:180°) steering;
......@@ -16,8 +16,17 @@ component Constant_velocity {
connect 0 /*Constant3*/-> steering;
connect switchBlock.out1 -> acceleration;
connect relationalOperator.out1 -> switchBlock.cond;
connect 2/*Constant2*/ -> switchBlock.in1;
connect 0/*Constant1*/ -> switchBlock.in3;
connect 2/*Constant2*/ -> switchBlock.in1; // this should give you a CoCo error
connect 0/*Constant1*/ -> switchBlock.in3; // this too (because 0 will be propagated to acceleration, but acceleration is not unit-less)
connect time -> relationalOperator.in1;
connect 1/*Constant*/ -> relationalOperator.in2;
/*
implementation Math {
B cond = time < 1s;
acceleration = cond ? 0 m/s^2 : 2 m/s^2;
steering = 0°;
}
*/
}
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