private void jComboBox3actionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3actionPerformed
// TODO add your handling code here:
    if (this.jComboBox3.getSelectedIndex() == 0) {
        return;
    }

    int ptr = this.jComboBox3.getSelectedIndex() - 1;
    String str = "The select event --- "+ "code index = "+ptr+"\n"+this.getCodeDispt(ptr);
    
    double[] tempGamma=new double[this.CRSM.gamma.length];
    System.arraycopy(this.CRSM.gamma, 0, tempGamma, 0, this.CRSM.gamma.length);
    CRSM.gamma=new double[]{(double) 1, (double)0};
    
    double[][] inPattern=new double[this.CRSM.numSpace][];
    for (int k=0;k<CRSM.numSpace;k++) {
         inPattern[k] = new double [CRSM.len[k]];
    }
    System.arraycopy(resetStatus(inPattern[0]), 0, inPattern[0], 0, inPattern[0].length);            
    System.arraycopy(resetStatus(inPattern[1]), 0, inPattern[1], 0, inPattern[1].length);
    inPattern[0][ptr*2]=1;
    inPattern[0][ptr*2+1]=0;
    
    System.out.println("Test for previuos event patter in:");
    String test_str="IF current siuation is : ";
    int[] preCode=this.getEventIdx(inPattern[0]);
    int[] curCode=this.getEventIdx(inPattern[1]);
    
    for(int i=0;i<curCode.length;i++){
        test_str+=curCode[i]+"\t";
    }
    test_str+="THEN previous siuation is : ";
    for(int i=0;i<preCode.length;i++){
        test_str+=preCode[i]+"\t";
    }
    
    System.out.println(test_str);
    
    int[] winners = this.CRSM.findWinnerK(inPattern, CRSM.FUZZYART,1,0.99);
    
    str+="**********************\n";
    str+="*Next event generated*\n";
    str+="**********************\n";
    
    if(winners==null){
        System.out.println("Unsuccessful retrieve!!!!");
        this.jTextArea1.setText(str+"N.A.");
        return;
    }
    
    for(int i=0;i<winners.length;i++){
        if(winners[winners.length-1]==this.CRSM.numCode-1){
            System.out.println("enters!!");
            int[] rewinners=new int[winners.length-1];
            System.arraycopy(winners, 0, rewinners, 0, rewinners.length);
            winners=new int[winners.length-1];
            winners=rewinners;
        }
        else{
            System.out.println("winner @ code "+winners[i]+": pattern consistent? "+this.isSamePattern(inPattern[0], CRSM.weight[winners[i]][0]));
            winners[i]=this.getEventIdx(CRSM.weight[winners[i]][1])[0];
        }
    }
    
    for(int i=0;i<winners.length;i++){
        if(winners[i]<this.episodic.eventLearner.numCode){
            str +=i+ ". "+ "code index = "+winners[i]+"\n"+this.getCodeDispt(winners[i])+"\n";
        }
    }
    
    this.jTextArea1.setText(str);
    System.arraycopy(tempGamma, 0, this.CRSM.gamma, 0, this.CRSM.gamma.length);
}//GEN-LAST:event_jComboBox3actionPerformed