haifa.shopsim.algorithms
Class RandomJobAlgorithm
java.lang.Object
|
+--haifa.shopsim.algorithms.AbstractAlgorithm
|
+--haifa.shopsim.algorithms.RandomJobAlgorithm
- All Implemented Interfaces:
- ShopAlgorithm
- public class RandomJobAlgorithm
- extends AbstractAlgorithm
This algorithms decides what do by drawing from a discrete
uniform distribution on all of the job classes that are
schedulable at a given time.
Field Summary |
(package private) double[] |
cumProb
|
(package private) static java.lang.String |
EXPLANATION
|
private int[] |
initialNr
|
private long |
lastSeed
Stores the value of the last seed that was used during a reset () method. |
private java.util.Random |
random
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
EXPLANATION
static final java.lang.String EXPLANATION
initialNr
private int[] initialNr
cumProb
double[] cumProb
random
private java.util.Random random
lastSeed
private long lastSeed
- Stores the value of the last seed that was used during a reset () method.
RandomJobAlgorithm
public RandomJobAlgorithm()
RandomJobAlgorithm
public RandomJobAlgorithm(ShopData shopData_,
ShopState shopState_,
java.io.PrintWriter log_)
RandomJobAlgorithm
public RandomJobAlgorithm(ShopData shopData_,
ShopState shopState_)
RandomJobAlgorithm
public RandomJobAlgorithm(ShopData shopData_)
setShopStateObject
public void setShopStateObject(ShopState shopState_)
- Description copied from interface:
ShopAlgorithm
- Set the algorithm's ShopState object. The algorithm looks at this Object and
makes decisions based on it whenever the whatNow message is called.
- Overrides:
setShopStateObject
in class AbstractAlgorithm
reset
public void reset()
- Resets the algorithm.
- Overrides:
reset
in class AbstractAlgorithm
whatNow
public ShopCommand whatNow(int machineNumber)
- Very simply reads a command from console and returns a ShopCommmand object.
explanationString
public java.lang.String explanationString()
- Description copied from interface:
ShopAlgorithm
- Returns a string telling a little bit about what the algorithm does.
- Overrides:
explanationString
in class AbstractAlgorithm
isDeterministic
public boolean isDeterministic()
- Description copied from interface:
ShopAlgorithm
- Returns true if the algorithm is determinsitic.
StaticGetAlgorithmName
public static java.lang.String StaticGetAlgorithmName()
getAlgorithmName
public java.lang.String getAlgorithmName()
- Description copied from interface:
ShopAlgorithm
- Returns a name of the algorithm.