Commit 7d173747 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Model: Z^{n} instead of Z^{n,1}

parent e8a29acd
...@@ -8,10 +8,10 @@ component CollisionToStop<N1 n = 2,N1 x = 1>{ ...@@ -8,10 +8,10 @@ component CollisionToStop<N1 n = 2,N1 x = 1>{
out B stopOut[n]; out B stopOut[n];
implementation Math{ implementation Math{
Z^{n,1} counter; Z^{n} counter;
Z^{x,1} indexLookup; Z^{x} indexLookup;
for i = 1:n for i = 1:n
counter(i,1) = 0; counter(i) = 0;
end end
Z k = 1; Z k = 1;
...@@ -19,13 +19,13 @@ component CollisionToStop<N1 n = 2,N1 x = 1>{ ...@@ -19,13 +19,13 @@ component CollisionToStop<N1 n = 2,N1 x = 1>{
for i = 1:maxI for i = 1:maxI
Z minJ = i + 1; Z minJ = i + 1;
for j = minJ:n for j = minJ:n
counter(i,1) = counter(i,1) + 1; counter(i) = counter(i) + 1;
counter(j,1) = counter(j,1) + 1; counter(j) = counter(j) + 1;
//always stop the last one to arrive at the collision point //always stop the last one to arrive at the collision point
if aIsFasterIn(k) if aIsFasterIn(k)
indexLookup(k,1) = j; indexLookup(k) = j;
else else
indexLookup(k,1) = i; indexLookup(k) = i;
end end
k = k + 1; k = k + 1;
end end
...@@ -39,7 +39,7 @@ component CollisionToStop<N1 n = 2,N1 x = 1>{ ...@@ -39,7 +39,7 @@ component CollisionToStop<N1 n = 2,N1 x = 1>{
if active if active
for i = 1:x for i = 1:x
if collisionIn(i) if collisionIn(i)
Z curIndex = indexLookup(i,1); Z curIndex = indexLookup(i);
stopOut(curIndex) = true; stopOut(curIndex) = true;
end end
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