Package jasima.shopSim.core
Class PR
- java.lang.Object
-
- jasima.shopSim.core.PR
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
ATC,ATCS,BFASFS,CR,CR.Variant1,CR.Variant2,DK,ECR,EDD,FASFS,FCFS,FCR,FEDD,FFCFS,GPRuleBase,IFTMinusUIT,Inverse,LBF,LookaheadThreshold,LW,MaxBatchSize,MDD,MMS,MOD,ODD,PTPlusWINQ,PTPlusWINQPlusNPT,PTPlusWINQPlusSlack,RND,SetupAvoidance,SI,SimplePR,SLK,SNSPT,SPT,SRPT,SRPTPerPT,SRPTPerSLK,SSPT,SST,TieBreakerFASFS,WINQ,WMDD,WMOD,WSPT,XWINQ
public abstract class PR extends Object implements Cloneable, Serializable
Abstract base class for a priority rule to be used to sequence items in aPriorityQueue.- Author:
- Torsten Hildebrandt
- See Also:
PriorityQueue, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PR()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanarrivesTooLate(PrioRuleTarget j)voidbeforeCalc(PriorityQueue<? extends PrioRuleTarget> q)This method is called by a queue before evaluating it's elements.abstract doublecalcPrio(PrioRuleTarget entry)Returns the priority value ofentry.PRclone()StringgetName()WorkStationgetOwner()PRgetTieBreaker()voidinit()This method is called upon start of a simulation to perform any initializations required.booleankeepIdle()If this method returns true, the machine is kept idle.PRprimaryRule()If this rule is used as a tie-breaker for another rule, PrimaryRule points to the rule this rule is the tieBreaker for, i.e.PRsetFinalTieBreaker(PR tieBreaker)Convenience method to set the last tie breaker rule in a chain.PRsetOwner(WorkStation o)voidsetTieBreaker(PR tieBreaker)Sets the tie breaker rule to use.StringtoString()
-
-
-
Field Detail
-
MIN_PRIO
public static final double MIN_PRIO
- See Also:
- Constant Field Values
-
MAX_PRIO
public static final double MAX_PRIO
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
This method is called upon start of a simulation to perform any initializations required.
-
beforeCalc
public void beforeCalc(PriorityQueue<? extends PrioRuleTarget> q)
This method is called by a queue before evaluating it's elements. Use it to do some initialization prior to calcPrio().- Parameters:
q- The current queue.
-
calcPrio
public abstract double calcPrio(PrioRuleTarget entry)
Returns the priority value ofentry. This method has to be overwritten by a priority rule.
-
keepIdle
public boolean keepIdle()
If this method returns true, the machine is kept idle. This method is called after beforeCalc(PriorityQueue) but before calcPrio(PrioRuleTarget).
-
getName
public String getName()
-
getOwner
public WorkStation getOwner()
-
setOwner
public PR setOwner(WorkStation o)
-
setTieBreaker
public void setTieBreaker(PR tieBreaker)
Sets the tie breaker rule to use.- Parameters:
tieBreaker- The tie-breaker to use.
-
setFinalTieBreaker
public PR setFinalTieBreaker(PR tieBreaker)
Convenience method to set the last tie breaker rule in a chain. The chain of rules is traversed until a rule without a tie breaker is found. The tie breaker of this rule is set totieBreaker.- Parameters:
tieBreaker- The tie-breaker to use.- Returns:
- The main rule, i.e.,
this. - See Also:
setTieBreaker(PR)
-
getTieBreaker
public PR getTieBreaker()
-
primaryRule
public PR primaryRule()
If this rule is used as a tie-breaker for another rule, PrimaryRule points to the rule this rule is the tieBreaker for, i.e.this.primaryRule().getTieBreaker()==this.
-
arrivesTooLate
public boolean arrivesTooLate(PrioRuleTarget j)
-
-