Package jasima.shopSim.prioRules.meta
Class SimplePR
- java.lang.Object
-
- jasima.shopSim.core.PR
-
- jasima.shopSim.prioRules.meta.SimplePR
-
- All Implemented Interfaces:
Serializable,Cloneable
public class SimplePR extends PR
Utility class that can be used to write simple priority rules as a lambda expression (PR itself is not a functional interface). So in order to express theSPTrule you can now writePR spt = new SimplePR("spt", job -> -job.currProcTime());instead of writing an anonymous inner class:PR spt = new PR() { @Override public double calcPrio(PrioRuleTarget job) { return -job.currProcTime(); } };- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSimplePR.JobEvaluator
-
Constructor Summary
Constructors Constructor Description SimplePR(SimplePR.JobEvaluator prioFunction)SimplePR(String name, SimplePR.JobEvaluator prioFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalcPrio(PrioRuleTarget entry)Returns the priority value ofentry.StringgetName()-
Methods inherited from class jasima.shopSim.core.PR
arrivesTooLate, beforeCalc, clone, getOwner, getTieBreaker, init, keepIdle, primaryRule, setFinalTieBreaker, setOwner, setTieBreaker, toString
-
-
-
-
Constructor Detail
-
SimplePR
public SimplePR(SimplePR.JobEvaluator prioFunction)
-
SimplePR
public SimplePR(String name, SimplePR.JobEvaluator prioFunction)
-
-