Commit f9ed77d4 authored by Sascha Dewes's avatar Sascha Dewes

updated streamtests

parent 091e44fe
......@@ -6,7 +6,7 @@ import forestrl.singlestep.agent.networks.ForestActor;
component Master {
ports
in Q^{488} networkState, //ros topic [RL]: "preprocessor/state"
out Q(0:1)^{63} netvalues; //ros topic [RL]: "postprocessor/action"
out Q^{63} netvalues; //ros topic [RL]: "postprocessor/action"
instance HelperConsts hc;
instance ForestActor net;
......
......@@ -6,7 +6,7 @@ import forestrl.singlestep.postprocessor.controller.Controller;
component Master {
ports
in Q^{7, 32, 32} simState, //ros topic: "sim/state"
in Q(0:1)^{63} netvalues, //ros topic: "postprocessor/netvalues"
in Q^{63} netvalues, //ros topic: "postprocessor/netvalues"
out Q^{6, 20, 2} action; //ros topic: "sim/action"
instance HelperConsts hc;
......
......@@ -3,7 +3,7 @@ package forestrl.singlestep.postprocessor.controller.utilities;
component FilterNewJobsTestWrapper {
ports
in Q^{3, 8} newjobinf,
in Q^{3} supply,
in Q^{3, 3} supplymatrix,
in Q^{3} sortedvalues,
in Z^{3} indices,
out Q^{3} jobpicks;
......@@ -11,7 +11,7 @@ component FilterNewJobsTestWrapper {
instance FilterNewJobs(3, 8, 3, 2) filter;
connect newjobinf -> filter.newjobinf;
connect supply -> filter.supply;
connect supplymatrix -> filter.supplymatrix;
connect sortedvalues -> filter.sortedvalues;
connect indices -> filter.indices;
connect filter.jobpicks -> jobpicks;
......
package forestrl.singlestep.postprocessor.controller.utilities;
import forestrl.singlestep.helper.HelperConsts;
component TotalSupply(Z maxsites, Z sitelen, Z woodtypes) {
ports
in Q^{maxsites, sitelen} siteinf,
out Q^{woodtypes} supply;
instance HelperConsts hc;
implementation Math {
Q^{woodtypes} result = zeros(woodtypes);
for i=1:maxsites
Z woodtype = siteinf(i, hc.SITE_TYPE);
Z logs = siteinf(i, hc.SITE_SUPPLY);
if woodtype > 0
result(woodtype) = result(woodtype) + logs;
end
end
supply = result;
}
}
package forestrl.singlestep.postprocessor.controller.utilities;
component TotalSupplyTestWrapper {
ports
in Q^{2, 22} siteinf,
out Q^{3} supply;
instance TotalSupply(2, 22, 3) totalsupply;
connect siteinf -> totalsupply.siteinf;
connect totalsupply.supply -> supply;
}
......@@ -8,14 +8,15 @@ stream ActionStageTest for ActionStageTestWrapper {
// 4: STAGE_LOAD because the forwarder is at the selected site and does not have any wood loaded
// 5: STAGE_PILE because the forwarder is at the selected site and has wood loaded
// 6: STAGE_UNLOAD because the forwarder is at the selected pile and has wood loaded
// 7: -1 because there is nothing to do
jobinf: [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; -1, -1, 2, 0, 0, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0];
newjobinf: [0, 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1];
forwarder: [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 50; 0; 0] tick [0; 0; 0; 50; 0; 0] tick [0; 0; 0; 0; 0; 0];
site: 1 tick 1 tick 1 tick 1 tick 1 tick 1 tick -1;
pile: 1 tick 1 tick 1 tick 1 tick 1 tick 1 tick -1;
atsite: 0 tick 0 tick 0 tick 1 tick 1 tick 0 tick 0;
atpile: 0 tick 0 tick 0 tick 0 tick 0 tick 1 tick 0;
// 7: STAGE_WAIT because there are still some unfinished jobs
// 8: -1 because there is nothing to do
jobinf: [5, 8, 2, 0, 5, 0, 0, 0; 3, 7, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 5, 0, 0, 0; -1, -1, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 5, 0, 0, 0; 3, 7, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 5, 0, 0, 0; 3, 7, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 5, 0, 0, 0; 3, 7, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 5, 0, 0, 0; 3, 7, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 5, 0, 0, 0; 3, 7, 2, 0, 5, 0, 0, 0] tick [5, 8, 2, 0, 0, 0, 0, 0; 3, 7, 2, 0, 0, 0, 0, 0];
newjobinf: [0, 0, 2, 0, 5, 0, 0, 0; 0, 0, 3, 0, 5, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1] tick [-1, -1, -1, -1, -1, -1, -1, -1; -1, -1, -1, -1, -1, -1, -1, -1];
forwarder: [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 50; 0; 0] tick [0; 0; 0; 50; 0; 0] tick [0; 0; 0; 0; 0; 0] tick [0; 0; 0; 0; 0; 0];
site: 1 tick 1 tick 1 tick 1 tick 1 tick 1 tick -1 tick -1;
pile: 1 tick 1 tick 1 tick 1 tick 1 tick 1 tick -1 tick -1;
atsite: 0 tick 0 tick 0 tick 1 tick 1 tick 0 tick 0 tick 0;
atpile: 0 tick 0 tick 0 tick 0 tick 0 tick 1 tick 0 tick 0;
stage: 1 tick 2 tick 3 tick 4 tick 5 tick 6 tick -1;
stage: 1 tick 2 tick 3 tick 4 tick 5 tick 6 tick 7 tick -1;
}
......@@ -6,7 +6,7 @@ stream FilterNewJobsTest for FilterNewJobsTestWrapper {
// 2: Choose jobs 1 and 3, because there is not enough supply for job 2
// 3: Choose jobs 2 and 3 as they have the highest ratings. Job 1 is not accepted, as maxjobs == 2 for this test
newjobinf: [0, 0, 2, 0, 200, 0, 0, 0; 0, 0, 3, 0, 150, 0, 0, 0; 0, 0, 3, 0, 100, 0, 0, 0] tick [0, 0, 2, 0, 200, 0, 0, 0; 0, 0, 3, 0, 150, 0, 0, 0; 0, 0, 3, 0, 100, 0, 0, 0] tick [0, 0, 2, 0, 200, 0, 0, 0; 0, 0, 3, 0, 150, 0, 0, 0; 0, 0, 3, 0, 100, 0, 0, 0];
supply: [0; 200; 250] tick [0; 200; 200] tick [0; 200; 250];
supplymatrix: [200, 0, 0; 0, 200, 200; 0, 50, 50] tick [200, 0, 0; 0, 200, 200; 0, 0, 0] tick [200, 0, 0; 0, 200, 200; 0, 50, 50];
sortedvalues: [0.8; 0.4; 0.3] tick [0.8; 0.7; 0.5] tick [0.8; 0.7; 0.5];
indices: [3; 2; 1] tick [3; 2; 1] tick [3; 2; 1];
......
......@@ -2,8 +2,8 @@ package forestrl.singlestep.postprocessor.controller.utilities;
stream FormatterTest for FormatterTestWrapper {
// TESTS:
// 1: split the input array into the different output arrays and matrices
netvalues: [0.11; 0.12; 0.211; 0.212; 0.221; 0.222; 0.31; 0.32; 0.41; 0.42; 0.51; 0.52; 0.53];
// 1: split the input array into the different output arrays and matrices and change range from [-1, 1] to [0, 1]
netvalues: [-0.78; -0.76; -0.578; -0.576; -0.558; -0.556; -0.38; -0.36; -0.18; -0.16; 0.02; 0.04; 0.06];
jobratings: [0.11; 0.12];
pilepositions: [0.211, 0.212; 0.221, 0.222];
......
......@@ -7,7 +7,7 @@ stream ForwarderPositionTest for ForwarderPositionTestWrapper {
// 3: neither are true because pile 2 and site 1 do not exist
// 4: neither are true because (pile == -1 || site == -1)
jobinf: [10, 20, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1] tick [10, 20, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1] tick [10, 20, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1] tick [10, 20, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1];
siteinf: [-1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0];
siteinf: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1; 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
forwarder: [10; 20; 0; 0; 0; 0] tick [25; 15; 0; 0; 0; 0] tick [10; 20; 0; 0; 0; 0] tick [10; 20; 0; 0; 0; 0];
pile: 1 tick 1 tick 2 tick -1;
site: 1 tick 2 tick 1 tick -1;
......
......@@ -6,7 +6,7 @@ stream LogLimitTest for LogLimitTestWrapper {
// 2: [30; -1] because compaclimit == 1 and empty forwarder weight > site 2 maxgreen (15000 > 14000)
// 3: [30; 0] because compaclimit == 2 and (21000-18000)/100 == 30 and (18000-18000)/200 == 0 [both limited by maxyellow]
// 4: [100; 50] because compaclimit == 3 and 10000/100 == 100 and 10000/200 == 50 [both limited by bunkcapacity]
siteinf: [0, 0, 0, 0, 0, 12000, 21000; -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 0, 18000, 21000; 0, 0, 0, 0, 0, 14000, 18000] tick [0, 0, 0, 0, 0, 18000, 21000; 0, 0, 0, 0, 0, 14000, 18000] tick [0, 0, 0, 0, 0, 18000, 21000; 0, 0, 0, 0, 0, 14000, 18000];
siteinf: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12000, 21000; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18000, 21000; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14000, 18000] tick [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18000, 21000; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14000, 18000] tick [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18000, 21000; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14000, 18000];
forwarder: [0; 0; 15000; 0; 10000; 0] tick [0; 0; 15000; 0; 10000; 0] tick [0; 0; 18000; 0; 10000; 0] tick [0; 0; 15000; 0; 10000; 0];
compaclimit: 1 tick 1 tick 2 tick 3;
logweights: [100; -1] tick [100; 200] tick [100; 200] tick [100; 200];
......
......@@ -4,7 +4,7 @@ stream LogWeightTest for LogWeightTestWrapper {
// TESTS:
// 1: 112 because KGPM_PINE*2 == 112, 77 because KGPM_BEECH*1 == 77
// 2: 84 because KGPM_OAK*1 == 84, -1 because site does not exist -> wood type is not defined
siteinf: [0, 0, 1, 2, 0, 0, 0; 0, 0, 2, 1, 0, 0, 0] tick [0, 0, 3, 1, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1];
siteinf: [0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
logweights: [112; 77] tick [84; -1];
}
......@@ -7,7 +7,7 @@ stream NextLogsTest for NextLogsTestWrapper {
// 3: 30 because min(50, 30, 35) == 30 [limited by supply]
// 4: 10 because min(10, 30, 25) == 10 [limited by demand]
jobinf: [0, 0, 0, 0, 50, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 50, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 50, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 10, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1];
siteinf: [0, 0, 0, 0, 30, 0, 0; -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 30, 0, 0; -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 30, 0, 0; -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 30, 0, 0; -1, -1, -1, -1, -1, -1, -1];
siteinf: [0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
pile: -1 tick 1 tick 1 tick 1;
site: -1 tick 1 tick 1 tick 1;
loglimits: [25; -1] tick [25; -1] tick [35; -1] tick [25; -1];
......
......@@ -4,12 +4,13 @@ stream NextPileTest for NextPileTestWrapper {
// TESTS:
// 1: choose pile 1 because pile 2 demand is 0
// 2: choose pile 1 because pile 2 position is undefined
// 3: choose no pile because site 1 is not reachable and site 2 has no supply
// 4: choose pile 2 because it has the higher pilevalue
jobinf: [1, 1, 2, 0, 50, 0, 0, 0; 2, 2, 3, 0, 0, 0, 0, 0] tick [1, 1, 2, 0, 50, 0, 0, 0; -1, -1, 3, 0, 50, 0, 0, 0] tick [1, 1, 2, 0, 50, 0, 0, 0; 2, 2, 3, 0, 50, 0, 0, 0] tick [1, 1, 2, 0, 50, 0, 0, 0; 2, 2, 3, 0, 50, 0, 0, 0];
siteinf: [0, 0, 2, 0, 80, 0, 0; 0, 0, 3, 0, 80, 0, 0] tick [0, 0, 2, 0, 80, 0, 0; 0, 0, 3, 0, 80, 0, 0] tick [0, 0, 2, 0, 80, 0, 0; 0, 0, 3, 0, 0, 0, 0] tick [0, 0, 2, 0, 80, 0, 0; 0, 0, 3, 0, 80, 0, 0];
pilevalues: [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8];
sitereachable: [1; 1] tick [1; 1] tick [0; 1] tick [1; 1];
// 3: choose pile 1 because there are no felling sites with matching type and length for pile 2
// 4: choose no pile because site 1 is not reachable and site 2 has no supply
// 5: choose pile 2 because it has the higher pilevalue
jobinf: [1, 1, 2, 4, 50, 0, 0, 0; 2, 2, 3, 4, 0, 0, 0, 0] tick [1, 1, 2, 4, 50, 0, 0, 0; -1, -1, 3, 4, 50, 0, 0, 0] tick [1, 1, 2, 4, 50, 0, 0, 0; 2, 2, 3, 8, 50, 0, 0, 0] tick [1, 1, 2, 4, 50, 0, 0, 0; 2, 2, 3, 4, 50, 0, 0, 0] tick [1, 1, 2, 4, 50, 0, 0, 0; 2, 2, 3, 4, 50, 0, 0, 0];
siteinf: [0, 0, 2, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
pilevalues: [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8];
sitereachable: [1; 1] tick [1; 1] tick [1; 1] tick [0; 1] tick [1; 1];
nextpile: 1 tick 1 tick -1 tick 2;
nextpile: 1 tick 1 tick 1 tick -1 tick 2;
}
......@@ -6,12 +6,13 @@ stream NextSiteTest for NextSiteTestWrapper {
// 2: 1 because site 2 supply == 0
// 3: 1 because sitereachable(2) == 0
// 4: 1 because site 2 wood type != pile 1 wood type
// 5: 2 because sitevalues(2) > sitevalues(1)
jobinf: [0, 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0, 0] tick [0, 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0, 0] tick [0, 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0, 0] tick [0, 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0, 0] tick [0, 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0, 0];
siteinf: [0, 0, 2, 0, 50, 0, 0; 0, 0, 2, 0, 30, 0, 0] tick [0, 0, 2, 0, 50, 0, 0; 0, 0, 2, 0, 0, 0, 0] tick [0, 0, 2, 0, 50, 0, 0; 0, 0, 2, 0, 30, 0, 0] tick [0, 0, 2, 0, 50, 0, 0; 0, 0, 3, 0, 30, 0, 0] tick [0, 0, 2, 0, 50, 0, 0; 0, 0, 2, 0, 30, 0, 0];
sitevalues: [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8];
sitereachable: [1; 1] tick [1; 1] tick [1; 0] tick [1; 1] tick [1; 1];
pile: -1 tick 1 tick 1 tick 1 tick 1;
// 5: 1 because site 2 log length != pile 1 log length
// 6: 2 because sitevalues(2) > sitevalues(1)
jobinf: [0, 0, 2, 4, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0] tick [0, 0, 2, 4, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0] tick [0, 0, 2, 4, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0] tick [0, 0, 2, 4, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0] tick [0, 0, 2, 4, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0] tick [0, 0, 2, 4, 0, 0, 0, 0; 0, 0, 3, 4, 0, 0, 0, 0];
siteinf: [0, 0, 2, 4, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2, 4, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2, 4, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 4, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2, 8, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 2, 4, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2, 4, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
sitevalues: [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8] tick [0.2; 0.8];
sitereachable: [1; 1] tick [1; 1] tick [1; 0] tick [1; 1] tick [1; 1] tick [1; 1];
pile: -1 tick 1 tick 1 tick 1 tick 1 tick 1;
nextsite: -1 tick 1 tick 1 tick 1 tick 2;
nextsite: -1 tick 1 tick 1 tick 1 tick 1 tick 2;
}
......@@ -4,7 +4,7 @@ stream ReachableSitesTest for ReachableSitesTestWrapper {
// TESTS:
// 1: [1; 0] because site 2 does not exist
// 2: [0; 1] because loglimit(1) < 1
siteinf: [0, 0, 2, 0, 50, 0, 0; -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 2, 0, 50, 0, 0; 0, 0, 3, 0, 30, 0, 0];
siteinf: [0, 0, 2, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 2, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 3, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
loglimits: [50; 100] tick [0; 100];
sitereachable: [1; 0] tick [0; 1];
......
package forestrl.singlestep.postprocessor.controller.utilities;
stream TotalSupplyTest for TotalSupplyTestWrapper {
// TESTS:
// 1: one undefined site
// 2: two sites with different wood types
// 3: two sites with the same wood type
siteinf: [0, 0, 2, 0, 100, 0, 0; -1, -1, -1, -1, -1, -1, -1] tick [0, 0, 2, 0, 100, 0, 0; 0, 0, 3, 0, 50, 0, 0] tick [0, 0, 2, 0, 100, 0, 0; 0, 0, 2, 0, 50, 0, 0];
supply: [0; 100; 0] tick [0; 100; 50] tick [0; 150; 0];
}
package forestrl.singlestep.preprocessor.utilities;
stream CompressorTest for CompressorTestWrapper {
// TODO: update this test to fit the new/longer siteinf
// TESTS:
// 1: combine all state infos into a single array
// 1: combine all state infos into a single array, only include forwarder-site and forwarder-pile distances
time: 1;
money: 2;
jobinf: [3, 4, 5, 6, 7, 8, 9, 10; 11, 12, 13, 14, 15, 16, 17, 18];
newjobinf: [19, 20, 21, 22, 23, 24, 25, 26; 27, 28, 29, 30, 31, 32, 33, 34];
siteinf: [35, 36, 37, 38, 39, 40, 41; 42, 43, 44, 45, 46, 47, 48];
distances: [49, 50, 51, 52, 53; 54, 55, 56, 57, 58; 59, 60, 61, 62, 63; 64, 65, 66, 67, 68; 69, 70, 71, 72, 73];
forwarder: [74; 75; 76; 77; 78; 79];
siteinf: [35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56; 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78];
//only last column of distance matrix matters, excluding forwarder-forwarder distance (last value in last column)
distances: [0, 0, 0, 0, 79; 0, 0, 0, 0, 80; 0, 0, 0, 0, 81; 0, 0, 0, 0, 82; 0, 0, 0, 0, 0];
forwarder: [83; 84; 85; 86; 87; 88];
compressed: [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79];
compressed: [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62; 63; 64; 65; 66; 67; 68; 69; 70; 71; 72; 73; 74; 75; 76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88];
}
......@@ -2,8 +2,8 @@ package forestrl.singlestep.preprocessor.utilities;
stream DefaultNeutralizerTest for DefaultNeutralizerTestWrapper {
// TESTS:
// 1: should replace every -1 with 0
state: [-1; 2; -1; 4; 5; 6; 7; 8; 9; -1];
// 1: should replace every -1 with 0, except money (second value)
state: [1; -1; -1; 4; 5; 6; 7; 8; 9; -1];
neutralized: [0; 2; 0; 4; 5; 6; 7; 8; 9; 0];
neutralized: [1; -1; 0; 4; 5; 6; 7; 8; 9; 0];
}
......@@ -2,9 +2,9 @@ package forestrl.singlestep.preprocessor.utilities;
stream DistanceScoreTest for DistanceScoreTestWrapper {
// TESTS:
// 1 and 2: maps distance values to scores between 0 (for longest possible distance) and 1 (for 0 distance)
// 1 and 2: maps distance values to scores between 0 (for longest possible euclidean distance) and 1 (for 0 distance)
// 2: undefined distances (-1) are unchanged, also shows lowest and highest distance values for mapsize == 32
distances: [0, 256, 128; 256, 0, 384; 128, 384, 0] tick [0, 1024, -1; 1024, 0, -1; -1, -1, -1];
distances: [0, 8, 4; 8, 0, 16; 4, 16, 0] tick [0, 45.2544, -1; 45.2544, 0, -1; -1, -1, -1];
scores: [1, 0.75, 0.875; 0.75, 1, 0.625; 0.875, 0.625, 1] tick [1, 0, -1; 0, 1, -1; -1, -1, -1];
scores: [1, 0.8232, 0.9116; 0.8232, 1, 0.6464; 0.9116, 0.6464, 1] tick [1, 0, -1; 0, 1, -1; -1, -1, -1];
}
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