Commit eada651f authored by rosemaryng's avatar rosemaryng
Browse files

Turned off debug feature and refactored Queue class to support new constructor

parent 7c59e709
......@@ -21,7 +21,7 @@ package jmt.engine.NetStrategies;
import jmt.common.AutoCheck;
import jmt.engine.QueueNet.Job;
import jmt.engine.QueueNet.JobClass;
import jmt.engine.QueueNet.JobInfo; //TODO: deleted in new version
import jmt.engine.QueueNet.JobInfo;
import jmt.engine.QueueNet.JobInfoList;
/**
......
......@@ -196,11 +196,11 @@ public class Queue extends InputSection {
}
/**
* Creates a new instance of finite Queue. This is the newest constructor that supports different drop strategies.
* Creates a new instance of finite Queue. This constructor supports indicating different drop strategies.
*
* @param dropStrategies Drop strategy per class: FINITE_DROP || FINITE_BLOCK || FINITE_WAITING || FINITE_RETRIAL.
*/
public Queue(Integer size, Integer maxRunning, Boolean serverPreemptive, String[] dropStrategies, ServiceStrategy[] retrials, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies) {
public Queue(Integer size, Integer maxRunning, Boolean serverPreemptive, String[] dropStrategies, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies) {
this(size.intValue(), maxRunning.intValue(), serverPreemptive.booleanValue(), false, getStrategy, putStrategies);
// Decodes drop strategies
this.dropStrategies = dropStrategies;
......@@ -216,7 +216,6 @@ public class Queue extends InputSection {
break;
case FINITE_RETRIAL:
isRetrialDR = true;
retrialDistributionStrategies = retrials;
case FINITE_WAITING:
default:
drop[i] = false;
......@@ -225,6 +224,22 @@ public class Queue extends InputSection {
}
}
public Queue(Integer size, String[] dropStrategies, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies) {
this(size.intValue(), -1, false, dropStrategies, getStrategy, putStrategies);
}
/**
* Creates a new instance of finite Queue. This is the newest constructor that supports retrial queues.
*
* @param dropStrategies Drop strategy per class: FINITE_DROP || FINITE_BLOCK || FINITE_WAITING || FINITE_RETRIAL.
*/
public Queue(Integer size, Integer maxRunning, Boolean serverPreemptive, String[] dropStrategies, ServiceStrategy[] retrials, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies) {
this(size.intValue(), maxRunning.intValue(), serverPreemptive.booleanValue(), dropStrategies, getStrategy, putStrategies);
// Decodes drop strategies
retrialDistributionStrategies = retrials;
}
public Queue(Integer size, String[] dropStrategies, ServiceStrategy[] retrials, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies) {
this(size.intValue(), -1, false, dropStrategies, retrials, getStrategy, putStrategies);
}
......@@ -235,14 +250,27 @@ public class Queue extends InputSection {
*
* @param impatienceStrategies Impatience strategies unique to each station and class.
*/
public Queue(Integer size, Integer maxRunning, Boolean serverPreemptive, String[] dropStrategies, ServiceStrategy[] retrials
public Queue(Integer size, Integer maxRunning, Boolean serverPreemptive, String[] dropStrategies
, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies, Impatience[] impatienceStrategies) {
// Called method with decoded drop Strategies
this(size, maxRunning, serverPreemptive, dropStrategies, retrials, getStrategy, putStrategies);
this(size, maxRunning, serverPreemptive, dropStrategies, getStrategy, putStrategies);
// Add impatience strategies for each class
impatienceStrategyPerStationClass = impatienceStrategies;
}
public Queue(Integer size, String[] dropStrategies, QueueGetStrategy getStrategy,
QueuePutStrategy[] putStrategies, Impatience[] impatienceStrategies) {
this(size, -1, false, dropStrategies, getStrategy, putStrategies, impatienceStrategies);
}
public Queue(Integer size, Integer maxRunning, Boolean serverPreemptive, String[] dropStrategies, ServiceStrategy[] retrials
, QueueGetStrategy getStrategy, QueuePutStrategy[] putStrategies, Impatience[] impatienceStrategies) {
// Called method with decoded drop Strategies
this(size, maxRunning, serverPreemptive, dropStrategies, getStrategy, putStrategies, impatienceStrategies);
// Add impatience strategies for each class
retrialDistributionStrategies = retrials;
}
public Queue(Integer size, String[] dropStrategies, ServiceStrategy[] retrials, QueueGetStrategy getStrategy,
QueuePutStrategy[] putStrategies, Impatience[] impatienceStrategies) {
this(size, -1, false, dropStrategies, retrials, getStrategy, putStrategies, impatienceStrategies);
......
......@@ -856,9 +856,6 @@ public class NetNode extends SimEntity {
return region != null;
}
/**
* @param true if this is a blocking region input station.
*/
public void setBlockingRegionInputStation(BlockingRegion region) {
this.region = region;
}
......
......@@ -87,7 +87,7 @@ import org.xml.sax.SAXNotSupportedException;
public class SimLoader {
//used for debug purposes
private static final boolean DEBUG = true;
private static final boolean DEBUG = false;
//represents the entire XML document. it is the root
//of the document tree, and provides the primary access to the document's data
......
......@@ -15,7 +15,7 @@ import jmt.jmva.analytical.solvers.SolverMultiClosedMVA;
import jmt.jmva.analytical.solvers.SolverSingleClosedMVA;
public class Moment {
private static final boolean DEBUG = true;
private static final boolean DEBUG = false;
private ExactModel model;
......
......@@ -41,7 +41,7 @@ import org.xml.sax.SAXException;
*/
public class SolverDispatcher {
private static final boolean DEBUG = true;
private static final boolean DEBUG = false;
private static final boolean PRINTMODEL = false;
private boolean stopped = false;
......
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