haifa.shopsim.algorithms
Class SimpleRandomAlgorithm
java.lang.Object
|
+--haifa.shopsim.algorithms.AbstractAlgorithm
|
+--haifa.shopsim.algorithms.SimpleRandomAlgorithm
- All Implemented Interfaces:
- ShopAlgorithm
- public class SimpleRandomAlgorithm
- 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) static java.lang.String |
EXPLANATION
|
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
random
private java.util.Random random
lastSeed
private long lastSeed
- Stores the value of the last seed that was used during a reset () method.
SimpleRandomAlgorithm
public SimpleRandomAlgorithm()
SimpleRandomAlgorithm
public SimpleRandomAlgorithm(ShopData shopData_,
ShopState shopState_,
java.io.PrintWriter log_)
SimpleRandomAlgorithm
public SimpleRandomAlgorithm(ShopData shopData_,
ShopState shopState_)
SimpleRandomAlgorithm
public SimpleRandomAlgorithm(ShopData shopData_)
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.