2023-11-19 02:12:44 +03:00
|
|
|
package TestingSystem.DVM.Configuration;
|
2023-09-17 22:13:42 +03:00
|
|
|
import Common.Database.DBObject;
|
2023-11-19 18:49:50 +03:00
|
|
|
import Common.Utils.Utils;
|
|
|
|
|
import GlobalData.RunConfiguration.RunConfiguration;
|
2024-09-14 00:18:27 +03:00
|
|
|
import TestingSystem.Common.Configuration;
|
2023-11-19 18:49:50 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
2024-09-14 00:18:27 +03:00
|
|
|
//конфгурация тестирования ДВМ
|
|
|
|
|
public class DVMConfiguration extends Configuration {
|
2023-09-17 22:13:42 +03:00
|
|
|
//компиляция.
|
|
|
|
|
public String flags = "\n";
|
|
|
|
|
public int c_maxtime = 40;
|
|
|
|
|
//матрица
|
2024-09-14 00:18:27 +03:00
|
|
|
public int cube = 0; //
|
2023-09-17 22:13:42 +03:00
|
|
|
public int max_proc_count = 4;
|
|
|
|
|
public int min_dim_proc_count = 1;
|
|
|
|
|
public int max_dim_proc_count = 4;
|
|
|
|
|
//запуск
|
|
|
|
|
public String environments="\n";
|
|
|
|
|
public String usr_par = "";
|
|
|
|
|
//-
|
|
|
|
|
@Override
|
2024-09-14 00:18:27 +03:00
|
|
|
public String getFlags() {
|
|
|
|
|
return flags;
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
2024-09-14 00:18:27 +03:00
|
|
|
@Override
|
|
|
|
|
public Vector<String> getFlagsArray() {
|
2023-11-19 18:49:50 +03:00
|
|
|
return Utils.unpackStrings(flags);
|
|
|
|
|
}
|
2024-09-14 00:18:27 +03:00
|
|
|
//-
|
2023-11-19 18:49:50 +03:00
|
|
|
public Vector<String> getEnvironments() {
|
|
|
|
|
return Utils.unpackStrings(environments);
|
|
|
|
|
}
|
|
|
|
|
public Vector<String> getParams() {
|
|
|
|
|
return Utils.unpackStrings(usr_par);
|
|
|
|
|
}
|
|
|
|
|
public Vector<String> getMatrixes(int testDim) {
|
|
|
|
|
Vector<Vector<Integer>> res_ = new Vector<>();
|
|
|
|
|
Vector<String> res = new Vector<>();
|
|
|
|
|
if ((max_proc_count==0) || (min_dim_proc_count == 0 && max_dim_proc_count == 0)) {
|
|
|
|
|
res.add("");
|
|
|
|
|
} else {
|
|
|
|
|
if (testDim > 0) {
|
|
|
|
|
Vector<String> min_border = new Vector<>();
|
|
|
|
|
Vector<String> max_border = new Vector<>();
|
|
|
|
|
for (int i = 1; i <= testDim; ++i) {
|
|
|
|
|
min_border.add(String.valueOf(min_dim_proc_count));
|
|
|
|
|
max_border.add(String.valueOf(max_dim_proc_count));
|
|
|
|
|
}
|
|
|
|
|
Vector<Integer> from = RunConfiguration.getBounds(String.join(" ", min_border));
|
|
|
|
|
Vector<Integer> to = RunConfiguration.getBounds(String.join(" ", max_border));
|
|
|
|
|
if (from.size() != to.size()) {
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
if (from.size() != testDim) {
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
//1 стадия. заполнение.
|
|
|
|
|
for (int j = from.get(0); j <= to.get(0); ++j) {
|
|
|
|
|
Vector<Integer> m = new Vector<>();
|
|
|
|
|
res_.add(m);
|
|
|
|
|
m.add(j);
|
|
|
|
|
}
|
|
|
|
|
//---
|
|
|
|
|
if (testDim > 1) RunConfiguration.gen_rec(from, to, res_, 1, testDim, cube == 1);
|
|
|
|
|
for (Vector<Integer> m : res_) {
|
|
|
|
|
Vector<String> ms = new Vector<>();
|
|
|
|
|
int proc = 1;
|
|
|
|
|
for (int i : m) {
|
|
|
|
|
ms.add(String.valueOf(i));
|
|
|
|
|
proc *= i;
|
|
|
|
|
}
|
|
|
|
|
if (proc <= max_proc_count)
|
|
|
|
|
res.add(String.join(" ", ms));
|
|
|
|
|
}
|
|
|
|
|
} else res.add("");
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
public String getParamsText() {
|
|
|
|
|
Vector<String> params = getParams();
|
|
|
|
|
if ((params.size() == 1) && params.get(0).isEmpty()) return "";
|
|
|
|
|
return String.join("\n", params);
|
|
|
|
|
}
|
2024-09-14 00:18:27 +03:00
|
|
|
//-
|
|
|
|
|
@Override
|
|
|
|
|
public void SynchronizeFields(DBObject src) {
|
|
|
|
|
super.SynchronizeFields(src);
|
|
|
|
|
DVMConfiguration c = (DVMConfiguration) src;
|
|
|
|
|
flags = c.flags;
|
|
|
|
|
c_maxtime=c.c_maxtime;
|
|
|
|
|
cube= c.cube;
|
|
|
|
|
max_proc_count=c.max_proc_count;
|
|
|
|
|
min_dim_proc_count=c.min_dim_proc_count;
|
|
|
|
|
max_dim_proc_count=c.max_dim_proc_count;
|
|
|
|
|
environments=c.environments;
|
|
|
|
|
usr_par=c.usr_par;
|
|
|
|
|
}
|
|
|
|
|
public DVMConfiguration(DVMConfiguration src){
|
|
|
|
|
this.SynchronizeFields(src);
|
2023-11-19 18:49:50 +03:00
|
|
|
}
|
2024-09-14 00:18:27 +03:00
|
|
|
public DVMConfiguration(){}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|