public int[] judge(){
		int[] order = new int[np];	//存放安全序列
		boolean[] finish = new boolean[np];//能否分配标志
		int[] work = new int[nr];	//工作向量
		work = this.getAvailable();	//工作向量开始等于available
		
		/*安全性检查核心*/
		int i=0,k=0,n=0;
		for( ;i < np; ){
			int count = 1;
			
			for(int j = 0;j < nr; j++){
				
				if( i<np && !finish[i]){//进程未分配才进行
					
					if( (this.p[i].maxNeed[j] - this.p[i].allocation[j]) <= work[j] ){
						count++;//必须每一个资源都检查,小于
						if(count == nr){		
                                                        table[n][0] = OP.toString(work);
							for(int m = 0;m < nr; m++){
								work[m] = work[m] + this.p[i].allocation[m];
                                                        }
							table[n][1] = OP.toString(p[i].getNeed());
                                                        table[n][2] = OP.toString(p[i].getAllocation());
                                                        table[n][3] = OP.toString( work);
                                                        table[n][4] = "True";
                                                        n++;
							finish[i] = true;
							order[k++] = i;                                                        
							i = 0;//从头开始检查
						}
					}
					else{
						//需求过大，检查下一个
						i++;
						continue;
					}

				}
				//该进程已经分配到资源，检查下一个
				else{
					i++;
					continue;
				}
			}
		}
		//检查所有finish
		for(i = 0;i < np; i++){
			if(!finish[i]){
                                
				return null;
			}
		}		
		return order;
		
	}