package data_fusion;
import java.text.NumberFormat;
public class Judgement {
void judge(float[]fs,float a1,float a2){
Max max=new Max();
SubMax submax=new SubMax();
if(max.max(fs)[0]-submax.submax(fs)>a1){
if(fs[fs.length-1]<a2){
if(max.max(fs)[0]>fs[fs.length-1]){
printout((int)max.max(fs)[1]);
}else System.out.println("条件3不满足!");
}else System.out.println("条件2不满足!");
}else System.out.println("条件1不满足");
}
public static void main(String[] args){
float[] fs1={0.668f,0.189f,0.128f,0.015f};
float[] fs2={0.102f,0.527f,0.361f,0.009f};
//float[] fs3={};
//float[] fs4={};
float[] temp,temp1,temp2,temp3=null;
Combination com=new Combination();
temp1=com.combination(fs1, fs2);
printformat("局部融合1: ",temp1);
/* temp2=com.combination(temp1,fs3);
printformat("局部融合2: ",temp2);
temp3=com.combination(temp2, fs4);
printformat("局部融合3: ",temp3);
temp=com.combination(temp2, fs1);
printformat("局部融合4: ",temp);
temp=com.combination(temp, fs2);
printformat("局部融合5: ",temp);
temp=com.combination(temp, fs3);
printformat("局部融合5: ",temp);
temp=com.combination(temp, fs4);
printformat("局部融合5: ",temp);*/
Judgement judge=new Judgement();
judge.judge(temp1, 0.1f, 0.1f);
}
void printout(int i){
System.out.print("\n 目标为:");
switch(i){
case 1: System.out.print("战斗机。");break;
case 2: System.out.print("多用途或地面攻击飞机。");break;
case 3: System.out.print("轰炸机。");break;
case 4: System.out.print("预警机");break;
default: System.out.print("其他飞行器");break;
}
}
static void printformat(String s,float[] temp){
for(int i1=0;i1<temp.length;i1++){
if(i1==temp.length-1)System.out.print(s+"m(U)="+temp[i1]+". ");
else System.out.print(s+"m(O"+(i1+1)+")="+temp[i1]+".");
}System.out.println("\n=====================================");
}
}
- 1
- 2
- 3
前往页