Commit f0a5335b authored by rosemaryng's avatar rosemaryng
Browse files

[Retry Full metrics] added new metrics waiting time and orbit length for...

[Retry Full metrics] added new metrics waiting time and orbit length for validation and new map in jobInfoList
parent 0e073615
......@@ -34,6 +34,8 @@ public class ImpatienceEditorFactory {
balkingEditor.show();
return impatienceParameter;
default:
return null;
}
......
......@@ -490,7 +490,7 @@ public class Queue extends InputSection {
job = message.getJob();
double randomDelay = retrial.generateRandomDelay();
double retrialTime = this.getNetSytem().getTime() + randomDelay;
retrialFullGroup.put(job.getId(), retrialTime);
nodeJobsList.addToRetrialOrbit(job.getId());
// System.out.println("Retrial signaled for " + job.getId() + " at " + retrialTime);
// System.out.println("retrialJobsCount: " + retried.size() + " retrials Total Count: " + retrialCount + " retrial group: " + retrialFullGroup.keySet() + " NodeJobsList: " + nodeJobsList.getInternalJobInfoList());
......@@ -532,8 +532,6 @@ public class Queue extends InputSection {
retried.add(job.getId());
nodeJobsList.retryJob(jobInfo);
netJobsList.retryJob(job);
}
if (job.getId() == 161) {
System.out.println("shit");
......@@ -600,7 +598,7 @@ public class Queue extends InputSection {
// Queue is not full. Okay.
if (retrialFullGroup.containsKey(job.getId())) {
// System.out.println(job.getId() + " proceeds.");
retrialFullGroup.remove(job.getId());
nodeJobsList.removeFromRetrialOrbit(job.getId());
}
// If parent node is a fork node adds job to FJ info list
......@@ -657,7 +655,7 @@ public class Queue extends InputSection {
// Retry Full route
if (dropStrategies != null && dropStrategies[0].equals(FINITE_RETRIAL)) {
// System.out.println(job.getId() + " full, will be retried. Time now: " + this.getNetSytem().getTime());
System.out.println("retrialJobsCount: " + retried.size() + " retrials Total Count: " + retrialCount + " retrial group: " + retrialFullGroup.keySet() + " NodeJobsList: " + nodeJobsList.getInternalJobInfoList());
System.out.println("retrialJobsCount: " + retried.size() + " retrials Total Count: " + retrialCount + " retrial group: " + nodeJobsList.getRetrialOrbit() + " NodeJobsList: " + nodeJobsList.getInternalJobInfoList());
sendMe(NetEvent.EVENT_RETRIAL, job, 0);
} else {
......
......@@ -55,6 +55,12 @@ public interface JobInfoList {
*/
public abstract int size(JobClass jobClass);
public Map<Integer, List<Double>> getRetrialOrbit();
public Map<Integer, List<Double>> addToRetrialOrbit(int id);
public void removeFromRetrialOrbit(int id);
/**
* Gets the number of added jobs.
* @return Number of added jobs.
......
......@@ -43,6 +43,9 @@ public class LinkedJobInfoList implements JobInfoList {
protected LinkedList<JobInfo> listPerClass[];
// Retrial group when the main jobsList (primary queue) is full
protected Map<Integer, List<Double>> retrialOrbit = new HashMap<>();
//arrivals and completions
protected int jobsIn;
......@@ -138,7 +141,8 @@ public class LinkedJobInfoList implements JobInfoList {
/** The number of servers to estimate Utilization measure on multiserver environments */
protected int numberOfServers = 1;
private NetSystem netSystem;
private NetSystem netSystem;
/**
* Creates a new JobInfoList instance.
* @param numberOfJobClasses number of job classes.
......@@ -181,6 +185,21 @@ public class LinkedJobInfoList implements JobInfoList {
return listPerClass[jobClass.getId()].size();
}
public Map<Integer, List<Double>> getRetrialOrbit() {
return retrialOrbit;
}
public Map<Integer, List<Double>> addToRetrialOrbit(int id) {
List<Double> currList = (retrialOrbit.get(id) == null ? new ArrayList<Double>() : retrialOrbit.get(id));
currList.add(this.getTime());
retrialOrbit.put(id, currList);
return retrialOrbit;
}
public void removeFromRetrialOrbit(int id) {
retrialOrbit.remove(id);
}
/* (non-Javadoc)
* @see jmt.engine.QueueNet.JobInfoList#getJobsIn()
*/
......
......@@ -107,6 +107,19 @@ public interface SimConstants {
/** Measure identifier: retrial rate of the system */
public static final int SYSTEM_RETRIAL_RATE = 31;
/** Measure identifier: number of jobs in the retrial orbit of the node */
public static final int NUMBER_OF_JOBS_IN_RETRIAL_ORBIT = 33;
/** Measure identifier: number of jobs in the retrial orbit of the system */
public static final int SYSTEM_NUMBER_OF_JOBS_IN_RETRIAL_ORBIT = 34;
/** Measure identifier: (total) waiting time of a job of a node (system entering time - time when job is pass to serving section) */
public static final int WAITING_TIME = 36;
/** Measure identifier: (total) waiting time of a job of the system (system entering time - time when job is pass to serving section) */
public static final int SYSTEM_WAITING_TIME = 37;
//-------------------- end SIMULATION MEASURE IDENTIFIERS -------------------------//
//-------------------- JOB LIST MEASURE IDENTIFIERS ----------------------------//
......@@ -135,6 +148,12 @@ public interface SimConstants {
/** Measure identifier: retrial rate of the list */
public static final int LIST_RETRIAL_RATE = 32;
/** Measure identifier: number of jobs in the retrial orbit in the list */
public static final int LIST_NUMBER_OF_JOBS_IN_RETRIAL_ORBIT = 35;
/** Measure identifier: (total) waiting time of a job of the list (system entering time - time when job is pass to serving section) */
public static final int LIST_WAITING_TIME = 38;
//-------------------- end JOB LIST MEASURE IDENTIFIERS -------------------------//
/** To be used for a blocking region measure */
......
......@@ -211,6 +211,18 @@ public interface MeasureDefinition {
*/
public int[] getRetrialRateMeasures();
/**
* Returns an array with the measureIndex of every retrialOrbit length measure
* @return an array with measures' index
*/
public int[] getRetrialOrbitLengthMeasures();
/**
* Returns an array with the measureIndex of every waiting time measure
* @return an array with measures' index
*/
public int[] getWaitingTime();
/**
* Returns an array with the measureIndex of every system customer number measure
* @return an array with measures' index
......@@ -259,6 +271,18 @@ public interface MeasureDefinition {
*/
public int[] getSystemRetrialRateMeasures();
/**
* Returns an array with the measureIndex of every system retrialOrbit length measure
* @return an array with measures' index
*/
public int[] getSystemRetrialOrbitLengthMeasures();
/**
* Returns an array with the measureIndex of every system waiting time measure
* @return an array with measures' index
*/
public int[] getSystemWaitingTime();
/**
* Returns an array with the measureIndex of every response time per sink measure
* @return an array with measures' index
......
......@@ -18,9 +18,7 @@
package jmt.gui.common.panels;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.GridLayout;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
......@@ -456,6 +454,19 @@ public class InputSectionPanel extends WizardPanel implements CommonConstants {
};
}
// An action to bring up a new window to edit the distribution based on the selected impatience type
private AbstractAction editRetrialFullParameter() {
return new AbstractAction("Edit Retrial Full") {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent e) {
queueTable.repaint();
}
};
}
/** This method:
* 1) Gets the corresponding editButtonRenderer based on the row parameter
* 2) Enables/disables the edit button depending on the selected impatience strategy for that row
......@@ -584,6 +595,10 @@ public class InputSectionPanel extends WizardPanel implements CommonConstants {
repaint();
} else if (columnIndex == COLUMN_DROP_RULE) {
data.setDropRule(stationKey, classKey, (String) aValue);
if (aValue.toString().equals(FINITE_RETRIAL)) {
}
System.out.println("set Value: " + aValue);
} else if (columnIndex == COLUMN_SERVICE_WEIGHT) {
try {
Double weight = Double.valueOf((String) aValue);
......
package jmt.gui.common.panels;
import java.awt.Container;
import jmt.gui.common.distributions.Distribution;
import jmt.gui.common.editors.BalkingStrategyEditor;
import jmt.gui.common.editors.DistributionsEditor;
import jmt.gui.common.serviceStrategies.LDStrategy;
public class RetrialEditor {
public static void displayEditor() {
// DistributionsEditor renegingEditor = DistributionsEditor.getInstance(parent, distribution);
// // Sets editor window title
// renegingEditor.setTitle(
// "Editing " + className + " Reneging Time Distribution...");
// // Shows editor window
// renegingEditor.show();
//
// return new RenegingParameter(renegingEditor.getResult());
}
}
......@@ -633,6 +633,7 @@ public class XMLReader implements XMLConstantNames, CommonConstants {
model.setStationServerPreemptive(key, serverPreemptive);
} else if (name.equals("dropStrategies")) {
dropRules = parseParameterRefclassArray(curr);
System.out.println(dropRules);
} else if (name.equals(ImpatienceType.IMPATIENCE.getDisplayName())) {
// Retrieves all impatience subParameters and sets them in the model
......
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