Commit ebbd400b authored by rosemaryng's avatar rosemaryng
Browse files

[Retry Full] Added constants and definitions for retrial rate

parent 7a0f5bf4
......@@ -73,6 +73,9 @@ public class GlobalJobInfoList {
private Measure responseTime;
private Measure[] responseTimePerClass;
private Measure retrialNum;
private Measure[] retrialNumPerClass;
private InverseMeasure dropRate;
private InverseMeasure[] dropRatePerClass;
......@@ -396,6 +399,22 @@ public class GlobalJobInfoList {
}
}
/**
* Analyzes System Number of retrials for a specific job class or for every class.
* @param jobClass specified job class. If null measure will be job independent.
* @param Measure reference to a Measure object.
*/
public void analyzeRetrialNumber(JobClass jobClass, Measure Measure) {
if (jobClass != null) {
if (jobNumPerClass == null) {
jobNumPerClass = new Measure[classNum];
}
jobNumPerClass[jobClass.getId()] = Measure;
} else {
jobNum = Measure;
}
}
// ------------------------------------------------------------------------------------
// --- Methods to update measures -----------------------------------------------------
......@@ -526,6 +545,8 @@ public class GlobalJobInfoList {
}
}
/**
* Updates chain graph.
* @param sourcePair source pair.
......
......@@ -319,6 +319,13 @@ public interface JobInfoList {
*/
public abstract void analyzeBalkingRate(JobClass jobClass, InverseMeasure measurement);
/**
* Analyzes the retrial rate for the specified job class.
* @param jobClass Specified job class. If null, analysis will be job class independent.
* @param measurement Reference to the associated inverse measure.
*/
public abstract void analyzeRetrialRate(JobClass jobClass, InverseMeasure measurement);
/**
* Analyzes the response time of a sink for the specified job class.
* @param jobClass Specified job class. If null, analysis will be job class independent.
......
......@@ -108,7 +108,6 @@ public class LinkedJobInfoList implements JobInfoList {
protected InverseMeasure dropRatePerClass[];
// add rates for retrial
protected InverseMeasure renegingRate;
......@@ -118,6 +117,12 @@ public class LinkedJobInfoList implements JobInfoList {
protected InverseMeasure balkingRatePerClass[];
// add rates for retrial
protected InverseMeasure retrialRate;
protected InverseMeasure retrialRatePerClass[];
protected Measure responseTimePerSink;
protected Measure responseTimePerSinkPerClass[];
......@@ -692,7 +697,6 @@ public class LinkedJobInfoList implements JobInfoList {
* @see jmt.engine.QueueNet.JobInfoList#analyzeDropRate(jmt.engine.QueueNet.JobClass, jmt.engine.dataAnalysis.InverseMeasure)
*/
public void analyzeBalkingRate(JobClass jobClass, InverseMeasure measurement) {
System.out.println("called analyse balking rate " + jobClass.getName() + measurement);
if (jobClass != null) {
if (balkingRatePerClass == null) {
balkingRatePerClass = new InverseMeasure[numberOfJobClasses];
......@@ -703,6 +707,11 @@ public class LinkedJobInfoList implements JobInfoList {
}
}
@Override
public void analyzeRetrialRate(JobClass jobClass, InverseMeasure measurement) {
}
/* (non-Javadoc)
* @see jmt.engine.QueueNet.JobInfoList#analyzeResponseTimePerSink(jmt.engine.QueueNet.JobClass, jmt.engine.dataAnalysis.InverseMeasure)
*/
......
......@@ -353,6 +353,9 @@ public class NetNode extends SimEntity {
case SimConstants.LIST_BALKING_RATE:
jobsList.analyzeBalkingRate(jobClass, (InverseMeasure) measurement);
break;
case SimConstants.LIST_RETRIAL_RATE:
jobsList.analyzeRetrialRate(jobClass, (InverseMeasure) measurement);
break;
case SimConstants.RESPONSE_TIME_PER_SINK:
jobsList.analyzeResponseTimePerSink(jobClass, measurement);
break;
......
......@@ -101,7 +101,11 @@ public interface SimConstants {
/** Measure identifier: reneging rate of the node */
public static final int BALKING_RATE = 22;
public static final int NUMBER_OF_RETRIALS = 30;
/** Measure identifier: retrial rate of the node */
public static final int RETRIAL_RATE = 30;
/** Measure identifier: retrial rate of the system */
public static final int SYSTEM_RETRIAL_RATE = 31;
//-------------------- end SIMULATION MEASURE IDENTIFIERS -------------------------//
......@@ -128,6 +132,9 @@ public interface SimConstants {
/** Measure identifier: reneging rate of the list */
public static final int LIST_BALKING_RATE = 29;
/** Measure identifier: retrial rate of the list */
public static final int LIST_RETRIAL_RATE = 32;
//-------------------- end JOB LIST MEASURE IDENTIFIERS -------------------------//
/** To be used for a blocking region measure */
......
......@@ -54,6 +54,8 @@ public abstract class EngineUtils {
return SimulationDefinition.MEASURE_RR;
case SimConstants.BALKING_RATE:
return SimulationDefinition.MEASURE_BR;
case SimConstants.RETRIAL_RATE:
return SimulationDefinition.MEASURE_R;
case SimConstants.SYSTEM_NUMBER_OF_JOBS:
return SimulationDefinition.MEASURE_S_CN;
case SimConstants.SYSTEM_RESPONSE_TIME:
......@@ -66,6 +68,8 @@ public abstract class EngineUtils {
return SimulationDefinition.MEASURE_S_RR;
case SimConstants.SYSTEM_BALKING_RATE:
return SimulationDefinition.MEASURE_S_BR;
case SimConstants.SYSTEM_RETRIAL_RATE:
return SimulationDefinition.MEASURE_S_R;
case SimConstants.SYSTEM_POWER:
return SimulationDefinition.MEASURE_S_P;
case SimConstants.RESPONSE_TIME_PER_SINK:
......@@ -112,6 +116,8 @@ public abstract class EngineUtils {
return SimConstants.RENEGING_RATE;
} else if (type.equals(SimulationDefinition.MEASURE_BR)) {
return SimConstants.BALKING_RATE;
} else if (type.equals(SimulationDefinition.MEASURE_R)) {
return SimConstants.RETRIAL_RATE;
} else if (type.equals(SimulationDefinition.MEASURE_S_CN)) {
return SimConstants.SYSTEM_NUMBER_OF_JOBS;
} else if (type.equals(SimulationDefinition.MEASURE_S_RP)) {
......@@ -126,6 +132,8 @@ public abstract class EngineUtils {
return SimConstants.SYSTEM_BALKING_RATE;
} else if (type.equals(SimulationDefinition.MEASURE_S_P)) {
return SimConstants.SYSTEM_POWER;
} else if (type.equals(SimulationDefinition.MEASURE_S_R)) {
return SimConstants.SYSTEM_RETRIAL_RATE;
} else if (type.equals(SimulationDefinition.MEASURE_RP_PER_SINK)) {
return SimConstants.RESPONSE_TIME_PER_SINK;
} else if (type.equals(SimulationDefinition.MEASURE_X_PER_SINK)) {
......@@ -162,7 +170,8 @@ public abstract class EngineUtils {
|| measureType == SimConstants.SYSTEM_BALKING_RATE
|| measureType == SimConstants.SYSTEM_POWER
|| measureType == SimConstants.THROUGHPUT_PER_SINK
|| measureType == SimConstants.FIRING_THROUGHPUT;
|| measureType == SimConstants.FIRING_THROUGHPUT
|| measureType == SimConstants.RETRIAL_RATE;
}
}
......@@ -42,7 +42,6 @@ import jmt.engine.NodeSections.ServiceTunnel;
import jmt.engine.NodeSections.Storage;
import jmt.engine.NodeSections.Terminal;
import jmt.engine.QueueNet.BlockingRegion;
import jmt.engine.QueueNet.Job;
import jmt.engine.QueueNet.JobClass;
import jmt.engine.QueueNet.NetNode;
import jmt.engine.QueueNet.NetSystem;
......@@ -524,6 +523,9 @@ public class Simulation {
case SimConstants.BALKING_RATE:
netNodes[nodePosition].analyze(SimConstants.LIST_BALKING_RATE, jClass, ms.getMeasure());
break;
case SimConstants.RETRIAL_RATE:
netNodes[nodePosition].analyze(SimConstants.LIST_RETRIAL_RATE, jClass, ms.getMeasure());
break;
case SimConstants.RESPONSE_TIME_PER_SINK:
netNodes[nodePosition].analyze(SimConstants.RESPONSE_TIME_PER_SINK, jClass, ms.getMeasure());
break;
......@@ -571,6 +573,8 @@ public class Simulation {
case SimConstants.SYSTEM_POWER:
network.getJobInfoList().analyzeSystemPower(jClass, ms.getMeasure());
break;
case SimConstants.SYSTEM_RETRIAL_RATE:
network.getJobInfoList().analyzeRetrialNumber(jClass, ms.getMeasure());
}
}
}
......
......@@ -205,6 +205,12 @@ public interface MeasureDefinition {
*/
public int[] getBalkingRateMeasures();
/**
* Returns an array with the measureIndex of every retrial rate measure
* @return an array with measures' index
*/
public int[] getRetrialRateMeasures();
/**
* Returns an array with the measureIndex of every system customer number measure
* @return an array with measures' index
......@@ -247,6 +253,12 @@ public interface MeasureDefinition {
*/
public int[] getSystemPowerMeasures();
/**
* Returns an array with the measureIndex of every system retrial rate measure
* @return an array with measures' index
*/
public int[] getSystemRetrialRateMeasures();
/**
* Returns an array with the measureIndex of every response time per sink measure
* @return an array with measures' index
......
......@@ -92,6 +92,9 @@ public interface ResultsConstants {
public static final String DESCRIPTION_BALKING_RATE = HTML_START + HTML_FONT_TITLE + "Balking Rate" + HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Average balking rate for each selected class at each selected station." + HTML_FONT_NOR_END + HTML_END;
public static final String DESCRIPTION_RETRIAL_RATE = HTML_START + HTML_FONT_TITLE + "Retrial Rate" + HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Average retrial rate for each selected class at each selected station." + HTML_FONT_NOR_END + HTML_END;
public static final String DESCRIPTION_SYSTEM_CUSTOMER_NUMBER = HTML_START + HTML_FONT_TITLE + "System Number of Customers" + HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Average number of customers in the entire system for each selected class." + HTML_FONT_NOR_END + HTML_END;
......@@ -113,6 +116,9 @@ public interface ResultsConstants {
public static final String DESCRIPTION_SYSTEM_POWER = HTML_START + HTML_FONT_TITLE + "System Power" + HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Average power of the entire system for each selected class." + HTML_FONT_NOR_END + HTML_END;
public static final String DESCRIPTION_SYSTEM_RETRIAL_RATE = HTML_START + HTML_FONT_TITLE + "System Retrial Rate" + HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Average retrial rate of the entire system for each selected class." + HTML_FONT_NOR_END + HTML_END;
public static final String DESCRIPTION_RESPONSE_TIME_PER_SINK = HTML_START + HTML_FONT_TITLE + "Response Time per Sink" + HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Average response time for each selected class at each selected Sink station." + HTML_FONT_NOR_END + HTML_END;
......
......@@ -53,6 +53,7 @@ public class ResultsModel implements MeasureDefinition {
private Vector<Integer> dropRate = new Vector<Integer>();
private Vector<Integer> renegingRate = new Vector<Integer>();
private Vector<Integer> balkingRate = new Vector<Integer>();
private Vector<Integer> retrialRate = new Vector<Integer>();
private Vector<Integer> systemCustomerNumber = new Vector<Integer>();
private Vector<Integer> systemResponseTime = new Vector<Integer>();
private Vector<Integer> systemThroughput = new Vector<Integer>();
......@@ -60,6 +61,7 @@ public class ResultsModel implements MeasureDefinition {
private Vector<Integer> systemRenegingRate = new Vector<Integer>();
private Vector<Integer> systemBalkingRate = new Vector<Integer>();
private Vector<Integer> systemPower = new Vector<Integer>();
private Vector<Integer> systemRetrialRate = new Vector<Integer>();
private Vector<Integer> responseTimePerSink = new Vector<Integer>();
private Vector<Integer> throughputPerSink = new Vector<Integer>();
private Vector<Integer> FCRTotalWeight = new Vector<Integer>();
......@@ -123,6 +125,8 @@ public class ResultsModel implements MeasureDefinition {
renegingRate.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_BR)) {
balkingRate.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_R)) {
retrialRate.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_S_CN)) {
systemCustomerNumber.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_S_RP)) {
......@@ -137,6 +141,8 @@ public class ResultsModel implements MeasureDefinition {
systemBalkingRate.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_S_P)) {
systemPower.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_S_R)) {
systemRetrialRate.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_RP_PER_SINK)) {
responseTimePerSink.add(new Integer(i));
} else if (type.equals(SimulationDefinition.MEASURE_X_PER_SINK)) {
......@@ -459,6 +465,19 @@ public class ResultsModel implements MeasureDefinition {
return tmp;
}
/**
* Returns an array with the measureIndex of every retrial rate measure
* @return an array with measures' index
*/
public int[] getRetrialRateMeasures() {
int[] tmp = new int[retrialRate.size()];
for (int i = 0; i < tmp.length; i++) {
tmp[i] = retrialRate.get(i).intValue();
}
return tmp;
}
/**
* Returns an array with the measureIndex of every system customer number measure
* @return an array with measures' index
......@@ -543,6 +562,19 @@ public class ResultsModel implements MeasureDefinition {
return tmp;
}
/**
* Returns an array with the measureIndex of every system retrial rate measure
* @return an array with measures' index
*/
public int[] getSystemRetrialRateMeasures() {
int[] tmp = new int[systemRetrialRate.size()];
for (int i = 0; i < tmp.length; i++) {
tmp[i] = systemRetrialRate.get(i).intValue();
}
return tmp;
}
/**
* Returns an array with the measureIndex of every response time per sink measure
* @return an array with measures' index
......
......@@ -67,6 +67,11 @@ public interface SimulationDefinition {
public static final String MEASURE_RR = "Reneging Rate";
/**Code for balking rate measure*/
public static final String MEASURE_BR = "Balking Rate";
/**Code for number of retrial number measure*/
public static final String MEASURE_R = "Retrial Rate";
/**Code for number of system retrial number measure*/
public static final String MEASURE_S_R = "System Retrial Rate";
/**Code for system reneging rate measure*/
public static final String MEASURE_S_RR = "System Reneging Rate";
/**Code for system reneging rate measure*/
......
......@@ -72,10 +72,10 @@ import jmt.gui.exact.table.ExactCellEditor;
* Time: 16.08.15
* Modified by Bertoli Marco 29/09/2005, 7-oct-2005
* 9-jan-2006 --> ComboBoxCellEditor
*
*
* Modified by Ashanka (May 2010):
* Description: Resized some column's width and edited the column headings.
*
*
* Modified by Ashanka (May 2010):
* Patch: Multi-Sink Perf. Index
* Description: Added new Performance index for capturing
......@@ -138,7 +138,8 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
SimulationDefinition.MEASURE_FCR_MO,
SimulationDefinition.MEASURE_FJ_CN,
SimulationDefinition.MEASURE_FJ_RP,
SimulationDefinition.MEASURE_FX
SimulationDefinition.MEASURE_FX,
SimulationDefinition.MEASURE_R,
};
// Measure selection ComboBox
......@@ -414,11 +415,12 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
|| measure.type.equals(SimulationDefinition.MEASURE_RP)
|| measure.type.equals(SimulationDefinition.MEASURE_DR)
|| measure.type.equals(SimulationDefinition.MEASURE_RR)
|| measure.type.equals(SimulationDefinition.MEASURE_BR)) {
|| measure.type.equals(SimulationDefinition.MEASURE_BR)
|| measure.type.equals(SimulationDefinition.MEASURE_R)) {
Vector<Object> vector = new Vector<Object>();
vector.add("");
vector.add("");
vector.addAll(stationData.getStationRegionKeysNoSourceSink());
vector.removeAll(stationData.getStationKeysTransition());
vector.removeAll(stationData.getStationKeysTransition());
return stationsCombos.getEditor(vector);
} else if (measure.type.equals(SimulationDefinition.MEASURE_QT)
|| measure.type.equals(SimulationDefinition.MEASURE_RD)
......@@ -532,17 +534,17 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
Measure measure = getExplicitMeasure(simData.getMeasureType(key),
simData.getMeasureStation(key), simData.getMeasureClass(key));
switch (columnIndex) {
case 0:
case 0:
return measure.type;
case 1:
case 1:
return measure.classKey;
case 2:
case 2:
return measure.stationKey;
case 3:
case 3:
return simData.getMeasureLog(key);
case 4:
case 4:
return simData.getMeasureAlpha(key);
case 5:
case 5:
return simData.getMeasurePrecision(key);
}
return null;
......@@ -553,38 +555,38 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
Object key = simData.getMeasureKeys().get(rowIndex);
Measure measure = null;
switch (columnIndex) {
case 0:
case 0:
measure = getImplicitMeasure(key, (String) aValue, getValueAt(rowIndex, 2), getValueAt(rowIndex, 1));
simData.setMeasureType(measure.type, key);
simData.setMeasureStation(measure.stationKey, key);
simData.setMeasureClass(measure.classKey, key);
fireTableRowsUpdated(rowIndex, rowIndex);
break;
case 1:
case 1:
measure = getImplicitMeasure(key, (String) getValueAt(rowIndex, 0), getValueAt(rowIndex, 2), aValue);
simData.setMeasureType(measure.type, key);
simData.setMeasureStation(measure.stationKey, key);
simData.setMeasureClass(measure.classKey, key);
fireTableRowsUpdated(rowIndex, rowIndex);
break;
case 2:
case 2:
measure = getImplicitMeasure(key, (String) getValueAt(rowIndex, 0), aValue, getValueAt(rowIndex, 1));
simData.setMeasureType(measure.type, key);
simData.setMeasureStation(measure.stationKey, key);
simData.setMeasureClass(measure.classKey, key);
fireTableRowsUpdated(rowIndex, rowIndex);
break;
case 3:
case 3:
simData.setMeasureLog((Boolean) aValue, key);
break;
case 4:
case 4:
try {
String doubleVal = (String) aValue;
simData.setMeasureAlpha(Double.valueOf(doubleVal), key);
} catch (NumberFormatException e) {
}
break;
case 5:
case 5:
try {
String doubleVal = (String) aValue;
simData.setMeasurePrecision(Double.valueOf(doubleVal), key);
......@@ -604,7 +606,9 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
|| type.equals(SimulationDefinition.MEASURE_S_DR)
|| type.equals(SimulationDefinition.MEASURE_S_RR)
|| type.equals(SimulationDefinition.MEASURE_S_BR)
|| type.equals(SimulationDefinition.MEASURE_S_P)) {
|| type.equals(SimulationDefinition.MEASURE_S_P)
|| type.equals(SimulationDefinition.MEASURE_S_R)
) {
return new Measure(getStationMeasureType(type), "", classKey);
} else {
return new Measure(type, stationKey, classKey);
......@@ -618,7 +622,8 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
|| type.equals(SimulationDefinition.MEASURE_DR)
|| type.equals(SimulationDefinition.MEASURE_RR)
|| type.equals(SimulationDefinition.MEASURE_BR)
|| type.equals(SimulationDefinition.MEASURE_P)) {
|| type.equals(SimulationDefinition.MEASURE_P)
|| type.equals(SimulationDefinition.MEASURE_R)) {
if (stationKey != null && stationKey.equals("")) {
return new Measure(getSystemMeasureType(type), null, classKey);
} else {
......@@ -650,6 +655,8 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
return SimulationDefinition.MEASURE_BR;
} else if (type.equals(SimulationDefinition.MEASURE_S_P)) {
return SimulationDefinition.MEASURE_P;
} else if (type.equals(SimulationDefinition.MEASURE_S_R)) {
return SimulationDefinition.MEASURE_R;
} else {
return null;
}
......@@ -670,6 +677,8 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
return SimulationDefinition.MEASURE_S_BR;
} else if (type.equals(SimulationDefinition.MEASURE_P)) {
return SimulationDefinition.MEASURE_S_P;
} else if (type.equals(SimulationDefinition.MEASURE_R)) {
return SimulationDefinition.MEASURE_S_R;
} else {
return null;
}
......@@ -678,7 +687,7 @@ public class MeasurePanel extends WizardPanel implements CommonConstants {
protected class Measure {
public String type;
public Object stationKey;
public Object stationKey;
public Object classKey;
public Measure(String type, Object stationKey, Object classKey) {
......
......@@ -153,6 +153,7 @@ public class ResultsWindow extends JMTFrame implements ResultsConstants {
addTabPane(mainPanel, SimulationDefinition.MEASURE_DR, DESCRIPTION_DROP_RATE, results.getDropRateMeasures());
addTabPane(mainPanel, SimulationDefinition.MEASURE_RR, DESCRIPTION_RENEGING_RATE, results.getRenegingRateMeasures());
addTabPane(mainPanel, SimulationDefinition.MEASURE_BR, DESCRIPTION_BALKING_RATE, results.getBalkingRateMeasures());
addTabPane(mainPanel, SimulationDefinition.MEASURE_R, DESCRIPTION_RETRIAL_RATE, results.getRetrialRateMeasures());
addTabPane(mainPanel, SimulationDefinition.MEASURE_S_CN, DESCRIPTION_SYSTEM_CUSTOMER_NUMBER, results.getSystemCustomerNumberMeasures());
addTabPane(mainPanel, SimulationDefinition.MEASURE_S_RP, DESCRIPTION_SYSTEM_RESPONSE_TIME, results.getSystemResponseTimeMeasures());
addTabPane(mainPanel, SimulationDefinition.MEASURE_S_X, DESCRIPTION_SYSTEM_THROUGHPUT, results.getSystemThroughputMeasures());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment