|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--haifa.shopsim.ShopStateImpl
This class represents the state of the jobshop at a given time instance as it is seen by an Algorithm. All the changes that occur during the simulation should be reflected in this class. This class is also used to schedule. (i.e. the scheduling algorithm should be able to generetate it's next command using the information in this class. Currently the state is the following:
Field Summary | |
private int[] |
finishedJobs
an array specifing how many finshed jobs per route. |
private boolean |
isRunning
Indicates that the shop is running. |
private java.util.HashMap |
QMap
A Map mapping Operation objects to sizes of queues. |
private java.util.ArrayList |
shopChangeListeners
A list of all listeners to this state, that is all classes that should be notified when the state changes. |
private ShopData |
shopData
A reference to the shop data object. |
private double |
time
The current simulation time. |
private boolean[] |
workingMachines
An array specifiing which of the machines is currently busy. |
Constructor Summary | |
ShopStateImpl(ShopData shopData_)
Cot'r builds state according to ShopData. |
Method Summary | |
void |
addShopChangeListener(ShopChangeListener scl)
Register a listener to the state. |
java.util.Collection |
getBusyMachines()
Returns a collection of all of the busy machines at the current time. |
int |
getNumFinishedJobs(int route)
Returns the number of finsihed jobs on a particular route. |
java.util.Map |
getQMap()
|
java.util.Collection |
getSchedulableOperations()
Returns a collection of the schedulable operations. |
double |
getTime()
Returns the time as registered with the state. |
int |
getTotalFinishedJobs()
Returns the total number of finished jobs. |
void |
shopChanged(ShopChangeEvent sce)
|
java.lang.String |
toString()
Returns string representing the ShopState |
void |
update(java.util.Map opMap)
Takes operation objects from opMap and updates relevant ones |
Methods inherited from class java.lang.Object |
|
Field Detail |
private boolean isRunning
private java.util.HashMap QMap
private boolean[] workingMachines
private int[] finishedJobs
private double time
private ShopData shopData
private java.util.ArrayList shopChangeListeners
Constructor Detail |
public ShopStateImpl(ShopData shopData_)
Method Detail |
public void addShopChangeListener(ShopChangeListener scl)
addShopChangeListener
in interface ShopState
public void shopChanged(ShopChangeEvent sce)
shopChanged
in interface ShopState
public void update(java.util.Map opMap)
public java.lang.String toString()
toString
in class java.lang.Object
public double getTime()
getTime
in interface ShopState
public java.util.Collection getBusyMachines()
getBusyMachines
in interface ShopState
public int getTotalFinishedJobs()
getTotalFinishedJobs
in interface ShopState
public int getNumFinishedJobs(int route)
getNumFinishedJobs
in interface ShopState
public java.util.Map getQMap()
getQMap
in interface ShopState
public java.util.Collection getSchedulableOperations()
getSchedulableOperations
in interface ShopState
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |