⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 solvermulti.java

📁 一个用于排队系统仿真的开源软件,有非常形象的图象仿真过程!
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
	 *  @return the queue length [center][class] matrix for the system
	 */
	public double[][] getQueueLen() {
		return queueLen;
	}

	/** Returns the residence time of the given class for the requested station
	 *  @param  cent    the number of the service center
	 *  @param  cls    the customer class
	 *  @return the residence time
	 */
	public double getResTime(int cent, int cls) {
		return residenceTime[cent][cls];
	}

	/**
	 * Returns the residence time of each class for each station
     * @return the residence times[center][class] matrix for the system
	 */
	public double[][] getResTime() {
		return residenceTime;
	}

	/** Returns the throughput for the requested service center
	 *  @param  cent    the number of the service center
	 *  @return the throughput
	 */
	public double getAggrThroughput(int cent) {
		return scThroughput[cent];
	}

	/**
	 * Returns the throughput for each service center
     * @return the throughput for each service center in the system
	 */
	public double[] getAggrThroughput() {
		return scThroughput;
	}

	/** Returns the utilization for the requested service center
	 **  @param  cent    the number of the service center
	 *  @return the utilization
	 */
	public double getAggrUtilization(int cent) {
		return scUtilization[cent];
	}

	/**
	 * Returns the utilization for each service center
     * @return the utilization for each service center in the system
	 */
	public double[] getAggrUtilization() {
		return scUtilization;
	}

	/** Returns the queue length for the requested service center
	 *  @param  cent    the number of the service center
	 *  @return the queue length
	 */
	public double getAggrQueueLen(int cent) {
		return scQueueLen[cent];
	}

	/**
     *  Returns the queue length for each service center
	 *  @return the queue length for each service center in the system
	 */
	public double[] getAggrQueueLen() {
		return scQueueLen;
	}

	/** Returns the residence time for the requested service center
	 *  @param  cent    the number of the service center
	 *  @return the residence time
	 */
	public double getAggrResTime(int cent) {
		return scResidTime[cent];
	}

	/**
     * Returns the residence time for each service center
	 *  @return the residence time for each service center in the system
	 */
	public double[] getAggrResTime() {
		return scResidTime;
	}

	/** Returns the response time of the whole system for the requested customer class
	 *  @param  cls    the customer class
	 *  @return the response time
	 */
	public double getClsResTime(int cls) {
		return clsRespTime[cls];
	}

	/**
	 * Returns the response time of the whole system for each customer class
     * @return the overall response time for each customer class in the system
	 */
	public double[] getClsResTime() {
		return clsRespTime;
	}

	/** Returns the throughput of the whole system for the requested customer class
	 *  @param  cls    the customer class
	 *  @return the overall throughput
	 */
	public double getClsThroughput(int cls) {
		return clsThroughput[cls];
	}

	/**
	 * Returns the throughput of the whole system for each customer class
     * @return the overall throughput for each customer class in the system
	 */
	public double[] getClsThroughput() {
		return clsThroughput;
	}


	/** Returns the response time of the system
	 *  @return the response time
	 */
	public double getTotResTime() {
		return sysResponseTime;
	}

	/** Returns the throughput of the system
	 *  @return the throughput
	 */
	public double getTotThroughput() {
		return sysThroughput;
	}

	/** Prints all the calculated indexes in the system.out.
	 *  It is used to debug or test the class.
	 */
	public void printIndexes() {
		for (int i = 0; i < stations; i++) {
			pw.println("Indexes of " + name[i]);
			for (int j = 0; j < classes; j++) {
				pw.println("of class " + j);
				pw.println("throughput        : " + throughput[i][j]);
				pw.println("utilization       : " + utilization[i][j]);
				pw.println("mean queue length : " + queueLen[i][j]);
			}
		}
	}

	/*

    OLD

	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append(getClass().getName());
		buf.append("\n------------------------------------");
		buf.append("\nAnalysis with SolverMulti");
		buf.append("\n");
		for (int i = 0; i < stations; i++) {
			buf.append("\n\n\nIndexes of " + name[i]);
			for (int j = 0; j < classes; j++) {
				buf.append("\n\nClass " + j);
				buf.append("\n- queue length      : " + queueLen[i][j]);
                buf.append("\n- residence time    : " + residenceTime[i][j]);
                buf.append("\n- throughput        : " + throughput[i][j]);
				buf.append("\n- utilization       : " + utilization[i][j]);

			}
			buf.append("\n\nAggregate values     : ");
            buf.append("\n- queue length       : " + scQueueLen[i]);
			buf.append("\n- residence time     : " + scResidTime[i]);
			buf.append("\n- throughput         : " + scThroughput[i]);
			buf.append("\n- utilization        : " + scUtilization[i]);
		}
		for (int j = 0; j < classes; j++) {
			buf.append("\n\nIndexes of class " + j);
			buf.append("\n- response time       : " + clsRespTime[j]);
			buf.append("\n- throughput          : " + clsRespTime[j]);
		}
		buf.append("\n\n");
        buf.append("\nSystem Response Time    : " + sysResponseTime);
		buf.append("\nSystem Throughput       : " + sysThroughput);
        buf.append("\nSystem users            : " + sysNumJobs);
		return buf.toString();
	}
    */


    //NEW
    //@author Stefano Omini

    /** creates a string of the principals parameters calculated
     *  @return the string
     */
    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append("\n------------------------------------");
        buf.append("\nAnalysis with MVA Multiclass");

        buf.append("\n\n");
        buf.append("Queue Length (Q)");
        buf.append("\n------------------------------------\n");
        for (int m = 0; m < stations; m++) {
            buf.append("[   ");
            for (int c = 0; c < classes; c++)
                buf.append(Printer.print(queueLen[m][c], 6) + "   ");
            buf.append("]\n");
        }

        buf.append("\n\n");
        buf.append("Residence Time (R)");
        buf.append("\n------------------------------------\n");
        for (int m = 0; m < stations; m++) {
            buf.append("[   ");
            for (int c = 0; c < classes; c++)
                buf.append(Printer.print(residenceTime[m][c], 6) + "   ");
            buf.append("]\n");
        }


        buf.append("\n\n");
                buf.append("Throughput (X)");
                buf.append("\n------------------------------------\n");
                for (int m = 0; m < stations; m++) {
                    buf.append("[   ");
                    for (int c = 0; c < classes; c++)
                        buf.append(Printer.print(throughput[m][c], 6) + "   ");
                    buf.append("]\n");
                }


        buf.append("\n\n");
        buf.append("Utilization (U)");
        buf.append("\n------------------------------------\n");
        for (int m = 0; m < stations; m++) {
            buf.append("[   ");
            for (int c = 0; c < classes; c++)
                buf.append(Printer.print(utilization[m][c], 6) + "   ");
            buf.append("]\n");
        }


        for (int i = 0; i < stations; i++) {
			buf.append("\n\nStation " + i + ": aggregated values");
            buf.append("\n  throughput       : " + scThroughput[i]);
			buf.append("\n  utilization      : " + scUtilization[i]);
            buf.append("\n  queue length     : " + scQueueLen[i]);
			buf.append("\n  residence time   : " + scResidTime[i]);
		}
		for (int j = 0; j < classes; j++) {
			buf.append("\n\nClass " + j + ": aggregated values");
			buf.append("\n  response time       : " + clsRespTime[j]);
			buf.append("\n  throughput          : " + clsThroughput[j]);
		}

		buf.append("\n\nSystem aggregate values");
        buf.append("\n  System Response Time    : " + sysResponseTime);
		buf.append("\n  System Throughput       : " + sysThroughput);
        buf.append("\n  System Number of jobs   : " + sysNumJobs);


        return buf.toString();
    }

    //end NEW

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -