haifa.shopsim.algorithms
Class SimpleRandomAlgorithm
java.lang.Object
|
+--haifa.shopsim.algorithms.SimpleRandomAlgorithm
- All Implemented Interfaces:
- ShopAlgorithm
- public class SimpleRandomAlgorithm
- extends java.lang.Object
- implements ShopAlgorithm
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 false since the user's actions are not specified in the algorithm. |
boolean |
quitCalled()
Returns true when the algorithm decided that it is time to quit. |
void |
setLog(java.io.PrintWriter log_)
The algorithm writes decision information to the log. |
void |
setShopData(ShopData shopData_)
Set the algorithm's shopData object, this is a reference for the general topology
of the job shop and for processing times. |
void |
setShopStateObject(ShopState shopState_)
Set the algorithm's ShopState object. |
static java.lang.String |
StaticGetAlgorithmName()
|
java.lang.String |
toString()
|
ShopCommand |
whatNow(int machineNumber)
Very simply reads a command from console and returns a ShopCommmand object. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
shopState
ShopState shopState
shopData
ShopData shopData
log
java.io.PrintWriter log
EXPLANATION
static final java.lang.String EXPLANATION
quitFlag
boolean quitFlag
SimpleRandomAlgorithm
public SimpleRandomAlgorithm(ShopData shopData_,
ShopState shopState_)
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.
- Specified by:
setShopStateObject
in interface ShopAlgorithm
setShopData
public void setShopData(ShopData shopData_)
- Description copied from interface:
ShopAlgorithm
- Set the algorithm's shopData object, this is a reference for the general topology
of the job shop and for processing times.
- Specified by:
setShopData
in interface ShopAlgorithm
setLog
public void setLog(java.io.PrintWriter log_)
- Description copied from interface:
ShopAlgorithm
- The algorithm writes decision information to the log.
- Specified by:
setLog
in interface ShopAlgorithm
whatNow
public ShopCommand whatNow(int machineNumber)
- Very simply reads a command from console and returns a ShopCommmand object.
- Specified by:
whatNow
in interface ShopAlgorithm
quitCalled
public boolean quitCalled()
- Returns true when the algorithm decided that it is time to quit.
- Specified by:
quitCalled
in interface ShopAlgorithm
explanationString
public java.lang.String explanationString()
- Description copied from interface:
ShopAlgorithm
- Returns a string telling a little bit about what the algorithm does.
- Specified by:
explanationString
in interface ShopAlgorithm
isDeterministic
public boolean isDeterministic()
- Returns false since the user's actions are not specified in the algorithm.
- Specified by:
isDeterministic
in interface ShopAlgorithm
StaticGetAlgorithmName
public static java.lang.String StaticGetAlgorithmName()
getAlgorithmName
public java.lang.String getAlgorithmName()
- Description copied from interface:
ShopAlgorithm
- Returns a name of the algorithm.
- Specified by:
getAlgorithmName
in interface ShopAlgorithm
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object