/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package qsim.resultProcessors;

import java.util.Scanner;

/**
 *
 * @author joe
 */
public class QueueEvResultProcessor extends ResultProcessor{

    private String capacity;
    
    public QueueEvResultProcessor (String result){
        this.result = new String(result);
        report = new String[6][5];
    }
    
    public QueueEvResultProcessor(String result, int capacity){
        this(result);
        this.capacity = new Integer(capacity).toString();
    }
    
    /**
     * Beállítja a report mátrixot
     * Sorai:
     * - Kapacitás
     * - Kihasználtság
     * - Sorhossz
     * - Várakozási idő
     * - Kiszolgálási idő
     * - Válaszidő
     * 
     * Oszlopai:
     * - min
     * - max
     * - átlag
     * - szórás
     * - igények száma
     * 
     * @return
     */
    
    @Override
    public void getStatistic(){
        Scanner sc = new Scanner(result);
        
        //kapacitás
        report[0][0] = capacity;
        report[0][1] = capacity;
        report[0][2] = null;
        report[0][3] = null;
        report[0][4] = null;
            
        //kihasználtság
        sc.next();
        report[1][0] = sc.next();
        report[1][1] = sc.next();
        report[1][2] = sc.next();
        report[1][3] = sc.nextLine().trim();
        report[1][4] = null;
        
            
        //sorhossz
        report[2][4] = sc.next();
        report[2][0] = sc.next();
        report[2][1] = sc.next();
        report[2][2] = sc.next();
        report[2][3] = sc.nextLine().trim();
        
             
        //várakozási idő
        report[3][4] = sc.next();
        report[3][0] = sc.next();
        report[3][1] = sc.next();
        report[3][2] = sc.next();
        report[3][3] = sc.nextLine().trim();
        
        
        //kiszolgálási idő
        sc.next();
        report[4][0] = sc.next();
        report[4][1] = sc.next();
        report[4][2] = sc.next();
        report[4][3] = sc.nextLine().trim();
        report[4][4] = null;
        
        //válaszidő
        report[5][4] = sc.next();
        report[5][0] = sc.next();
        report[5][1] = sc.next();
        report[5][2] = sc.next();
        report[5][3] = sc.nextLine().trim();
        
        lossRatio = sc.next();
        sc.close();
    }

}
