修改判读方案算法
This commit is contained in:
@@ -624,6 +624,10 @@ public class StatisticalControlledTest {
|
||||
*
|
||||
* */
|
||||
private static void rule5Core(List<Point> data,Integer m,Integer n){
|
||||
if(data.size() == 0 || data.size() == 1){
|
||||
return;
|
||||
}
|
||||
|
||||
//开始
|
||||
Stack<Point> stack = new Stack<Point>();
|
||||
int seqNum = 0;
|
||||
@@ -655,6 +659,8 @@ public class StatisticalControlledTest {
|
||||
seqNum++;
|
||||
}
|
||||
//判断最后一次情况
|
||||
Integer nowi = i>= data.size()?(i-1):i;
|
||||
i = nowi;
|
||||
Boolean sequence = ((stack.peek().getPosition()+1) == data.get(i).getPosition());
|
||||
if( sequence ){
|
||||
stack.push(data.get(i));
|
||||
@@ -793,6 +799,9 @@ public class StatisticalControlledTest {
|
||||
// return result;
|
||||
// }
|
||||
private static void rule6Core(List<Point> data,Integer m,Integer n){
|
||||
if(data.size() == 0 || data.size() == 1){
|
||||
return;
|
||||
}
|
||||
//开始
|
||||
Stack<Point> stack = new Stack<Point>();
|
||||
int seqNum = 0;
|
||||
@@ -824,6 +833,8 @@ public class StatisticalControlledTest {
|
||||
seqNum++;
|
||||
}
|
||||
//判断最后一次情况
|
||||
Integer nowi = i>= data.size()?(i-1):i;
|
||||
i = nowi;
|
||||
Boolean sequence = ((stack.peek().getPosition()+1) == data.get(i).getPosition());
|
||||
if( sequence ){
|
||||
stack.push(data.get(i));
|
||||
@@ -951,6 +962,9 @@ public class StatisticalControlledTest {
|
||||
// return result;
|
||||
// }
|
||||
private static void rule7Core(List<Point> data,Integer n){
|
||||
if(data.size() == 0 || data.size() == 1){
|
||||
return;
|
||||
}
|
||||
//开始
|
||||
Stack<Point> stack = new Stack<Point>();
|
||||
int i = 0;
|
||||
@@ -980,6 +994,8 @@ public class StatisticalControlledTest {
|
||||
|
||||
}
|
||||
//判断最后一次情况
|
||||
Integer nowi = i>= data.size()?(i-1):i;
|
||||
i = nowi;
|
||||
Boolean sequence = ((stack.peek().getPosition()+1) == data.get(i).getPosition());
|
||||
if( sequence ){
|
||||
stack.push(data.get(i));
|
||||
@@ -1101,6 +1117,9 @@ public class StatisticalControlledTest {
|
||||
// return result;
|
||||
// }
|
||||
private static void rule8Core(List<Point> data,Integer n){
|
||||
if(data.size() == 0 || data.size() == 1){
|
||||
return;
|
||||
}
|
||||
//开始
|
||||
Stack<Point> stack = new Stack<Point>();
|
||||
int i = 0;
|
||||
@@ -1130,6 +1149,8 @@ public class StatisticalControlledTest {
|
||||
|
||||
}
|
||||
//判断最后一次情况
|
||||
Integer nowi = i>= data.size()?(i-1):i;
|
||||
i = nowi;
|
||||
Boolean sequence = ((stack.peek().getPosition()+1) == data.get(i).getPosition());
|
||||
if( sequence ){
|
||||
stack.push(data.get(i));
|
||||
|
||||
@@ -45,7 +45,10 @@ public class MainRule5TEST {
|
||||
seqNum++;
|
||||
}
|
||||
//判断最后一次情况
|
||||
Boolean sequence = ((stack.peek().getPosition()+1) == upforMarkKey.get(i).getPosition());
|
||||
Integer nowi = i>= upforMarkKey.size()?(i-1):i;
|
||||
i = nowi;
|
||||
Integer c = (stack.peek().getPosition()+1);
|
||||
Boolean sequence = ( c == upforMarkKey.get(i).getPosition());
|
||||
if( sequence ){
|
||||
stack.push(upforMarkKey.get(i));
|
||||
seqNum++;
|
||||
@@ -92,19 +95,19 @@ public class MainRule5TEST {
|
||||
|
||||
|
||||
upforMarkKey.add(point1);
|
||||
upforMarkKey.add(point2);
|
||||
upforMarkKey.add(point3);
|
||||
upforMarkKey.add(point4);
|
||||
upforMarkKey.add(point5);
|
||||
upforMarkKey.add(point6);
|
||||
upforMarkKey.add(point7);
|
||||
upforMarkKey.add(point8);
|
||||
upforMarkKey.add(point9);
|
||||
upforMarkKey.add(point10);
|
||||
upforMarkKey.add(point11);
|
||||
upforMarkKey.add(point12);
|
||||
upforMarkKey.add(point13);
|
||||
upforMarkKey.add(point14);
|
||||
// upforMarkKey.add(point2);
|
||||
// upforMarkKey.add(point3);
|
||||
// upforMarkKey.add(point4);
|
||||
// upforMarkKey.add(point5);
|
||||
// upforMarkKey.add(point6);
|
||||
// upforMarkKey.add(point7);
|
||||
// upforMarkKey.add(point8);
|
||||
// upforMarkKey.add(point9);
|
||||
// upforMarkKey.add(point10);
|
||||
// upforMarkKey.add(point11);
|
||||
// upforMarkKey.add(point12);
|
||||
// upforMarkKey.add(point13);
|
||||
// upforMarkKey.add(point14);
|
||||
|
||||
|
||||
rule5Core(upforMarkKey);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cnbm.qualityPlanning.entity;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.NumberUtils;
|
||||
|
||||
/**
|
||||
* @Desc: ""
|
||||
@@ -27,19 +29,19 @@ public class ControlLimitDetail {
|
||||
this.CL = CL;
|
||||
this.LCL = LCL;
|
||||
Double agv1 = (this.UCL-this.CL)/3;
|
||||
this.UC[0] = this.CL;
|
||||
this.UC[1] = this.CL+agv1;
|
||||
this.UB[0] = this.UC[1];
|
||||
this.UB[1] = this.UB[0]+agv1;
|
||||
this.UA[0] = this.UB[1];
|
||||
this.UA[1] = this.UA[0]+agv1;
|
||||
this.UC[0] = NumberUtil.round(this.CL,4).doubleValue();
|
||||
this.UC[1] = NumberUtil.round(this.CL+agv1,4).doubleValue();
|
||||
this.UB[0] = NumberUtil.round(this.UC[1],4).doubleValue();
|
||||
this.UB[1] = NumberUtil.round(this.UB[0]+agv1,4).doubleValue();
|
||||
this.UA[0] = NumberUtil.round(this.UB[1],4).doubleValue();
|
||||
this.UA[1] = NumberUtil.round(this.UA[0]+agv1,4).doubleValue();
|
||||
|
||||
Double agv2 = (this.CL-this.LCL)/3;
|
||||
this.LC[0] = this.CL-agv2;
|
||||
this.LC[1] = this.CL;
|
||||
this.LB[0] = this.LC[0]-agv2;
|
||||
this.LB[1] = this.LC[0];
|
||||
this.LA[0] = this.LB[0]-agv2;
|
||||
this.LA[1] = this.LB[0];
|
||||
this.LC[0] = NumberUtil.round(this.CL-agv2,4).doubleValue();
|
||||
this.LC[1] = NumberUtil.round(this.CL,4).doubleValue();
|
||||
this.LB[0] = NumberUtil.round(this.LC[0]-agv2,4).doubleValue();
|
||||
this.LB[1] = NumberUtil.round(this.LC[0],4).doubleValue();
|
||||
this.LA[0] = NumberUtil.round(this.LB[0]-agv2,4).doubleValue();
|
||||
this.LA[1] = NumberUtil.round(this.LB[0],4).doubleValue();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user