Skip to main content
. 2017 Mar 21;17(3):642. doi: 10.3390/s17030642
Algorithm 3: The threat degree of elementary intrusion algorithm
Input: The Stack of Integer value.
Output: threat.
1. The number of different priorities attack from different source at the same time is stored in the object value;
2. h = value.get(4);
3. m = value.get(3);
4. l = value.get(2);
5. lst = value.get(1);
6. k = value.get(0);
7. for (int i = 0; i < 5; i++){
8. sum1 = h*Math.pow(10, 5*1) + m*Math.pow(10, 4*0.8) + l*Math.pow(10, 3*0.6) + lst*Math.pow(10, 2*0.4) + k*Math.pow(10, 1*0.2);
9. int sum = h + m + l + lst +k;
10. if(sum==0){
11. return 0;}}
12. double weight = sum1/(sum*100);
13. double threat = Math.pow(10, weight);
14. Return threat.