• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++cocoaobjective-cc#誰得gamephpbathyscaphelinuxqtrubycomegat翻訳pythontwitterwindowsbtronvb.nettestframeworkgui計画中(planning stage)directxpreviewerpukiwikidommruby

IPODwBDD


Commit MetaInfo

Revisioncf83fde293953c77d91d3815b9a49b9e996f0ca9 (tree)
Time2017-10-13 14:16:20
AuthorTatsuhiro Tsuchiya <tatsuhiro@ieee...>
CommiterTatsuhiro Tsuchiya

Log Message

[bug fix] a big bug fixed

A validity check was missing.

Change Summary

Incremental Difference

--- a/src/v1/Generator.java
+++ b/src/v1/Generator.java
@@ -32,7 +32,8 @@ abstract class Generator {
3232 final int numOfParameters;
3333 final Random rnd;
3434
35- static final int MaxNumOfTestcases = 65532;
35+// static final int MaxNumOfTestcases = 65532;
36+ static final int MaxNumOfTestcases = 5000;
3637
3738 Generator(ParameterModel parametermodel, GList groupList,
3839 ConstraintHandler constrainthandler, List<Testcase> seed,
--- a/src/v1/IPOG.java
+++ b/src/v1/IPOG.java
@@ -122,6 +122,19 @@ public class IPOG extends Generator {
122122 if (!(matrix[row][cg.c[i]] < 0 || (byte)(tuple[i]) == matrix[row][cg.c[i]]))
123123 break iteration;
124124
125+ /* validity check requred!!!*/
126+ Testcase tmp = new Testcase(parametermodel.size);
127+ tmp.quantify();
128+ for (int j = 0; j <strength -1; j++) {
129+ tmp.set(cg.c[j], (byte) tuple[j]);
130+ }
131+ for (int j = 0; j < factor; j++) {
132+ if (tmp.get(j) < 0)
133+ tmp.set(j, matrix[row][j]);
134+ }
135+ if (constrainthandler.isPossible(tmp) == false)
136+ break iteration;
137+
125138 matrix[row][factor] = (byte) tuple[strength-1];
126139 assert(tuple[strength -1] < parametermodel.range[factor]);
127140
--- a/src/v1/Main.java
+++ b/src/v1/Main.java
@@ -44,15 +44,18 @@ public class Main {
4444 // モデル読み込み
4545 // System.err.println("starting reading model");
4646 InputFileData inputfiledata = Inputer.readModel(modelFile);
47-
48- // 制約処理 BDD作成
47+ System.out.println("Parameters :\t" + inputfiledata.parameterList.size());
48+ System.out.println("Strength:\t" + strength);
49+ // 制約処理 BDD作成
4950 // System.err.println("starting building bdd");
5051 ConstraintHandler conhndl = new ConstraintHandler(
5152 inputfiledata.parameterList, inputfiledata.constraintList, inputfiledata.constrainedParameters);
5253 // DEBUG: BDDの表示
5354 /* conhndl.printConstraintBDD(); */
5455
55- System.err.println("done with BDD");
56+ long endbdd = System.currentTimeMillis();
57+ System.out.println("BDD tm:\t" + (endbdd - start) + "ms");
58+ // System.err.println("BDD sz:\t" + conhndl.bddConstraint);
5659
5760 // シード読み込み
5861 List<Testcase> seed = Inputer.readSeed(seedFile, inputfiledata);
@@ -127,7 +130,7 @@ public class Main {
127130 new Outputer(outputFile).outputResult(testSet, inputfiledata,
128131 randomSeed, modelFile, seedFile, outputFile, strength,
129132 numOfIterations);
130- System.err.println("size: " + testSet.size());
133+ System.out.println("Number of Tests:\t" + testSet.size());
131134 }
132135
133136 /* debug */
@@ -143,7 +146,7 @@ public class Main {
143146 }
144147
145148 long end = System.currentTimeMillis();
146- System.err.println("time: " + (end - start) + "ms");
149+ System.out.println("Time:\t" + (end - start) + "ms");
147150 }
148151
149152 // コマンド引数処理
--- a/src/v1/Outputer.java
+++ b/src/v1/Outputer.java
@@ -41,13 +41,14 @@ public class Outputer {
4141 String outputFile, int strength, int numOfIterations) {
4242
4343 inputfiledata.parameterList.assignID2();
44+
4445 Collections.sort(inputfiledata.parameterList, new Comparator<Parameter>(){
4546 @Override
4647 public int compare(Parameter arg0, Parameter arg1) {
4748 return arg0.id1 -arg1.id1;
4849 }
4950 });
50-
51+
5152 try {
5253 String firstline = "#SUCCESS" + "," + randomSeed + "," + "i" + ","
5354 + (modelFile == null ? "" : modelFile) + "," + "s" + ","
--- a/src/v1/TestcaseHandler.java
+++ b/src/v1/TestcaseHandler.java
@@ -87,7 +87,7 @@ class Testcase {
8787 int i = P.id2;
8888 writer.write((firstIteration ? "" : ",")
8989 +
90- (value[i] >= 0 ? P.value_name.get(value[i]) : "-"));
90+ (value[i] >= 0 ? P.value_name.get(value[i]) : "*"));
9191 firstIteration = false;
9292 }
9393 writer.write("\n");