diff src/main/java/alice/test/codesegment/local/factorial/StartCodeSegment.java @ 523:145c425db88d dispose

add CompressedLDSM
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Thu, 09 Apr 2015 18:36:26 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/alice/test/codesegment/local/factorial/StartCodeSegment.java	Thu Apr 09 18:36:26 2015 +0900
@@ -0,0 +1,38 @@
+package alice.test.codesegment.local.factorial;
+
+import alice.codesegment.CodeSegment;
+import alice.test.codesegment.local.TestCodeSegment;
+
+/**
+ * Created by e125769 on 2/24/15.
+ */
+public class StartCodeSegment extends CodeSegment{
+
+    @Override
+    public void run() {//データをセット&表示をするCS
+        System.out.println("run StartCodeSegment");
+
+        FactorialCodeSegment cs[] = new FactorialCodeSegment[4];//計算するCSを用意
+
+        System.out.println("create FactorialCodeSegment");
+
+        for (int i = 0; i < cs.length; i++){//4回CSを走らせている
+            cs[i] = new FactorialCodeSegment(5, "key" + i);//配列にCSインスタンスを代入 newした時点でコンストラクタのsetKeyでデータを取りに行く
+        }
+
+        for (long i = 1; i <= 20; i++) {//1~100までを4つのキューに格納
+            if (i <= 5){//一応パイプライン状に走る
+                ods.put("local", "key0", i);
+            } else if (5 < i && i <= 10){
+                ods.put("local", "key1", i);
+            } else if (10 < i && i <= 15){
+                ods.put("local", "key2", i);
+            } else{
+                ods.put("local", "key3", i);
+            }
+        }
+
+
+    }
+
+}