Commit 40852bae authored by Sascha Dewes's avatar Sascha Dewes

added stream tests for NextUpdate, SupplyMatrix and MSActionStage

parent d224ac09
Pipeline #396144 failed with stage
in 10 minutes and 33 seconds
......@@ -13,7 +13,7 @@ component MSController(Z mapsize, Z maxjobs, Z joblen, Z newjobs, Z maxsites, Z
in Q^{newjobs, joblen} newjobinf, //used by filter, stage
in Q^{maxsites, sitelen} siteinf, //used by logweight, loglimit, reachable, nextpile, nextsite, nextlogs
in Q^{distlen, distlen} distances, //not used
in Q^{forwlen} forwarder, //used by loglimit, stage, selactions
in Q^{forwlen} forwarder, //used by loglimit, selactions
in Q^{nnaclen} netvalues,
out Q^{acx, acy, acz} action;
......@@ -32,7 +32,7 @@ component MSController(Z mapsize, Z maxjobs, Z joblen, Z newjobs, Z maxsites, Z
instance NextPile(maxjobs, joblen, maxsites, sitelen) nextpile;
instance NextSite(maxjobs, joblen, maxsites, sitelen) nextsite;
instance NextLogs(maxjobs, joblen, maxsites, sitelen) nextlogs;
instance MSActionStage(maxjobs, joblen, newjobs, forwlen) stage;
instance MSActionStage(maxjobs, joblen, newjobs) stage;
instance NextUpdate(maxsites, sitelen) update;
instance MSSelectActions(maxjobs, joblen, maxsites, sitelen, forwlen, newjobs, acx, acy, acz) selactions;
......@@ -88,7 +88,6 @@ component MSController(Z mapsize, Z maxjobs, Z joblen, Z newjobs, Z maxsites, Z
//stage
connect jobinf -> stage.jobinf;
connect newjobinf -> stage.newjobinf;
connect forwarder -> stage.forwarder;
connect nextsite.nextsite -> stage.site;
connect nextpile.nextpile -> stage.pile;
//update
......
......@@ -3,11 +3,10 @@ package forestrl.multistep.postprocessor.controller.utilities;
import forestrl.singlestep.helper.HelperConsts;
import forestrl.multistep.helper.MSConsts;
component MSActionStage(Z maxjobs, Z joblen, Z newjobs, Z forwlen) {
component MSActionStage(Z maxjobs, Z joblen, Z newjobs) {
ports
in Q^{maxjobs, joblen} jobinf,
in Q^{newjobs, joblen} newjobinf,
in Q^{forwlen} forwarder,
in Z site,
in Z pile,
out Z stage;
......
package forestrl.multistep.postprocessor.controller.utilities;
component MSActionStageTestWrapper {
ports
in Q^{2, 8} jobinf,
in Q^{2, 8} newjobinf,
in Z site,
in Z pile,
out Z stage;
instance MSActionStage(2, 8, 2) actionstage;
connect jobinf -> actionstage.jobinf;
connect newjobinf -> actionstage.newjobinf;
connect site -> actionstage.site;
connect pile -> actionstage.pile;
connect actionstage.stage -> stage;
}
package forestrl.multistep.postprocessor.controller.utilities;
stream MSActionStageTest for MSActionStageTestWrapper {
// TESTS:
// 1: MS_STAGE_ACCEPT because there are new jobs available
// 2: MS_STAGE_PLACE because one of the jobs does not have a wood pile yet
// 3: MS_STAGE_DELIVER because the agent can make a delivery (site and pile are both defined)
// 4: MS_STAGE_WAIT because there are still some unfinished jobs
// 5: -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, 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];
site: 1 tick 1 tick 1 tick -1 tick -1;
pile: 1 tick 1 tick 1 tick -1 tick -1;
stage: 1 tick 2 tick 3 tick 4 tick -1;
}
package forestrl.singlestep.postprocessor.controller.utilities;
stream NextUpdateTest for NextUpdateTestWrapper {
// TESTS:
// 1: next update is a supply update for site 1
// 2: next update is a soil update for site 2
siteinf: [0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0] tick [0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0];
waittime: 100 tick;
}
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