haifa.shopsim.algorithms
Class AbstractAlgorithm

java.lang.Object
  |
  +--haifa.shopsim.algorithms.AbstractAlgorithm
All Implemented Interfaces:
ShopAlgorithm
Direct Known Subclasses:
BGFluidAlgorithm, BufferPriorityAlgorithm, DWFluidAlgorithm, FIAalgorithm, RandomJobAlgorithm, SimpleRandomAlgorithm, SmartRandomAlgorithm

public abstract class AbstractAlgorithm
extends java.lang.Object
implements ShopAlgorithm

This class implements the ShopAlgorithm interface and handles some of the work that should be perofrmed by any algorithm. (Associations to shop data, state log etc...).

Version:
1.1

Field Summary
(package private)  java.io.PrintWriter log
           
(package private)  ShopData shopData
           
(package private)  ShopSimulation shopSimulation
           
(package private)  ShopState shopState
           
 
Constructor Summary
AbstractAlgorithm()
           
AbstractAlgorithm(ShopData shopData_)
           
AbstractAlgorithm(ShopData shopData_, java.io.PrintWriter log_)
           
AbstractAlgorithm(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.
 boolean quitCalled()
          Returns true when the algorithm decided that it is time to quit. (by default, always returns false, unless overloaded)
 void reset()
          Does nothing, (may be overridden).
 void setEnabled(boolean enabled)
          Does nothing, (may be overridden).
 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 setShopSimulationObject(ShopSimulation shopSimulation_)
          Set the algorithm's shop simulation object.
 void setShopStateObject(ShopState shopState_)
          Set the algorithm's ShopState object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface haifa.shopsim.ShopAlgorithm
getAlgorithmName, isDeterministic, whatNow
 

Field Detail

log

java.io.PrintWriter log

shopData

ShopData shopData

shopState

ShopState shopState

shopSimulation

ShopSimulation shopSimulation
Constructor Detail

AbstractAlgorithm

public AbstractAlgorithm()

AbstractAlgorithm

public AbstractAlgorithm(ShopData shopData_)

AbstractAlgorithm

public AbstractAlgorithm(ShopData shopData_,
                         ShopState shopState_,
                         java.io.PrintWriter log_)

AbstractAlgorithm

public AbstractAlgorithm(ShopData shopData_,
                         java.io.PrintWriter log_)
Method Detail

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

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

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

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

setShopSimulationObject

public void setShopSimulationObject(ShopSimulation shopSimulation_)
Set the algorithm's shop simulation object. The algorithm may interact with a shop simulation object by giving it askAgainAtCurrentTime(machine number) signals.
Specified by:
setShopSimulationObject in interface ShopAlgorithm

quitCalled

public boolean quitCalled()
Returns true when the algorithm decided that it is time to quit. (by default, always returns false, unless overloaded)

reset

public void reset()
Does nothing, (may be overridden).
Specified by:
reset in interface ShopAlgorithm

setEnabled

public void setEnabled(boolean enabled)
Does nothing, (may be overridden).

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object