Rename value ports to val

parent 9e639bd1
......@@ -7,11 +7,11 @@ component CombineValues {
in Z valueCoins,
in Z valueEnemies,
out Z value;
out Z val;
implementation Math {
// some weightning here
value = valueCoins + valueEnemies;
val = valueCoins + valueEnemies;
}
}
\ No newline at end of file
......@@ -55,22 +55,22 @@ component ConeSearches {
connect enemiesWeights.towardsPacMan -> enemiesTop.ghostFacingPacManWight, enemiesBottom.ghostFacingPacManWight, enemiesLeft.ghostFacingPacManWight, enemiesRight.ghostFacingPacManWight;
connect enemiesWeights.eatable -> enemiesTop.ghostEatableWeight, enemiesBottom.ghostEatableWeight, enemiesLeft.ghostEatableWeight, enemiesRight.ghostEatableWeight;
connect coinsTop.value -> enhancer.valueIn[1];
connect coinsBottom.value -> enhancer.valueIn[2];
connect coinsLeft.value -> enhancer.valueIn[3];
connect coinsRight.value -> enhancer.valueIn[4];
connect coinsTop.val -> enhancer.valueIn[1];
connect coinsBottom.val -> enhancer.valueIn[2];
connect coinsLeft.val -> enhancer.valueIn[3];
connect coinsRight.val -> enhancer.valueIn[4];
connect enhancer.valueOut[1] -> combine1.valueCoins;
connect enhancer.valueOut[2] -> combine2.valueCoins;
connect enhancer.valueOut[3] -> combine3.valueCoins;
connect enhancer.valueOut[4] -> combine4.valueCoins;
connect enemiesTop.value -> combine1.valueEnemies;
connect enemiesBottom.value -> combine2.valueEnemies;
connect enemiesLeft.value -> combine3.valueEnemies;
connect enemiesRight.value -> combine4.valueEnemies;
connect enemiesTop.val -> combine1.valueEnemies;
connect enemiesBottom.val -> combine2.valueEnemies;
connect enemiesLeft.val -> combine3.valueEnemies;
connect enemiesRight.val -> combine4.valueEnemies;
connect combine1.value -> topValue;
connect combine2.value -> bottomValue;
connect combine3.value -> leftValue;
connect combine4.value -> rightValue;
connect combine1.val -> topValue;
connect combine2.val -> bottomValue;
connect combine3.val -> leftValue;
connect combine4.val -> rightValue;
}
\ No newline at end of file
......@@ -8,10 +8,10 @@ component SearchCoinsBottom {
in Z buiscuitWeight,
in Z coinWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:21
Z indexY = round(currentY) + i + 1;
if indexY < 22
......@@ -27,7 +27,7 @@ component SearchCoinsBottom {
multBy = coinWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multBy/(dist*dist));
val = val + (multBy/(dist*dist));
end
end
end
......
......@@ -8,10 +8,10 @@ component SearchCoinsLeft {
in Z buiscuitWeight,
in Z coinWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:18
Z indexX = currentX - i + 1;
if indexX > 0
......@@ -27,7 +27,7 @@ component SearchCoinsLeft {
multBy = coinWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multBy/(dist*dist));
val = val + (multBy/(dist*dist));
end
end
end
......
......@@ -8,10 +8,10 @@ component SearchCoinsRight {
in Z buiscuitWeight,
in Z coinWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:18
Z indexX = round(currentX) + i + 1;
if indexX < 19
......@@ -27,7 +27,7 @@ component SearchCoinsRight {
multBy = coinWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multBy/(dist*dist));
val = val + (multBy/(dist*dist));
end
end
end
......
......@@ -8,10 +8,10 @@ component SearchCoinsTop {
in Z buiscuitWeight,
in Z coinWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:21
Z indexY = currentY - i + 1;
if indexY > 0
......@@ -27,7 +27,7 @@ component SearchCoinsTop {
multBy = coinWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multBy/(dist*dist));
val = val + (multBy/(dist*dist));
end
end
end
......
......@@ -12,10 +12,10 @@ component SearchEnemiesBottom {
in Z ghostFacingPacManWight,
in Z ghostEatableWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:8
Z indexY = round(currentY) + i;
if indexY < 22
......@@ -34,7 +34,7 @@ component SearchEnemiesBottom {
multiplyer = ghostEatableWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multiplyer/dist);
val = val + (multiplyer/dist);
end
end
end
......
......@@ -12,10 +12,10 @@ component SearchEnemiesLeft {
in Z ghostFacingPacManWight,
in Z ghostEatableWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:8
Z indexX = round(currentX) - i;
if indexX > 0
......@@ -34,7 +34,7 @@ component SearchEnemiesLeft {
multiplyer = ghostEatableWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multiplyer/dist);
val = val + (multiplyer/dist);
end
end
end
......
......@@ -12,10 +12,10 @@ component SearchEnemiesRight {
in Z ghostFacingPacManWight,
in Z ghostEatableWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:8
Z indexX = round(currentX) + i;
if indexX < 19
......@@ -34,7 +34,7 @@ component SearchEnemiesRight {
multiplyer = ghostEatableWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multiplyer/dist);
val = val + (multiplyer/dist);
end
end
end
......
......@@ -12,10 +12,10 @@ component SearchEnemiesTop {
in Z ghostFacingPacManWight,
in Z ghostEatableWeight,
out Z value;
out Z val;
implementation Math {
value = 0;
val = 0;
for i = 1:8
Z indexY = round(currentY) - i;
if indexY > 0
......@@ -34,7 +34,7 @@ component SearchEnemiesTop {
multiplyer = ghostEatableWeight;
end
Q dist = sqrt(i*i + j*j);
value = value + (multiplyer/dist);
val = val + (multiplyer/dist);
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