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
           
 
Fields inherited from class haifa.shopsim.algorithms.AbstractAlgorithm
log, shopData, shopSimulation, shopState
 
Constructor Summary
SimpleRandomAlgorithm()
           
SimpleRandomAlgorithm(ShopData shopData_)
           
SimpleRandomAlgorithm(ShopData shopData_, ShopState shopState_)
           
SimpleRandomAlgorithm(ShopData shopData_, ShopState shopState_, java.io.PrintWriter log_)
           
 
Method Summary
 java.lang.String explanationString()
          Returns a string telling a little bit about what the algorithm does.
 java.lang.String getAlgorithmName()
          Returns a name of the algorithm.
 boolean isDeterministic()
          Returns true if the algorithm is determinsitic.
 void reset()
          Resets the algorithm.
static java.lang.String StaticGetAlgorithmName()
           
 ShopCommand whatNow(int machineNumber)
          Very simply reads a command from console and returns a ShopCommmand object.
 
Methods inherited from class haifa.shopsim.algorithms.AbstractAlgorithm
quitCalled, setEnabled, setLog, setShopData, setShopSimulationObject, setShopStateObject, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

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.
Constructor Detail

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_)
Method Detail

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.