haifa.shopsim
Interface ShopState

All Known Implementing Classes:
FastShopRun

public interface ShopState

This interface is implemented by classes that summrise info regarding the state of the job shop. It is the ShopState that is used by ShopAlgorithms to make scheduling decisions. A shopstate allows to register ShopChangeListeners to it and informs them of changes whenever there is a state in the shop.

Note that some methods have to do with the dynamic (changing) state of the shop, such as getFreeMachines(), yet other method have to do with the job shop problem instance for example: getInitialNr().

Version:
1.1

Method Summary
 void addShopChangeListener(ShopChangeListener scl)
          Register a listener to the state.
 int[] getBusyMachines()
          Returns an array of all of the busy machines at the current time.
 double getExpectedMachineLowerBound()
          Returns the maximum of getExpectedProcessingTimes().
 double getExpectedProcessingTime(int machine)
          Uses the getInitialNr result and the means in the shop data to calcualte how much time a machine is expected to process.
 double[] getExpectedProcessingTimes()
          Returns an array with the expectedProcssing time for each machine.
 int[] getFreeMachines()
          Returns an array of all of the free machines at the current time.
 int[] getInitialNr()
          Returns the initial number of jobs on each route.
 Operation[] getMachineActivities()
          Returns an array of Operation objects, with a length the same as the number of machines in the shop.
 int getNumFinishedJobs(int route)
          Returns the number of finsihed jobs on a particular route.
 java.util.Map getQMap()
          Returns a Map whose keys are operation objects (meaning the queues waiting for each opeartion).
 java.util.Map getQPlusMap()
          Returns a Map whose keys are operation objects (meaning the queues waiting for each opeartion).
 java.util.Collection getSchedulableOperations()
          Returns a collection of the schedulable operations.
 java.util.Collection getSchedulableOperations(int machineNumber)
          Returns a collection of the schedulable operations for a specific machine.
 double getTime()
          Returns the time as registered with the state.
 int getTotalFinishedJobs()
          Returns the total number of finished jobs.
 boolean isMachineDone(int machineNumber)
          Returns true if the machine does not have anymore jobs left to do in the job shop.
 boolean isMachineStarved(int machineNumber)
          Returns true if the machine has jobs upstream (as specified in the QPlusMap) and it's buffers are empty.
 

Method Detail

getTime

public double getTime()
Returns the time as registered with the state.

getBusyMachines

public int[] getBusyMachines()
Returns an array of all of the busy machines at the current time. (Machines are numbered starting at 1).

getFreeMachines

public int[] getFreeMachines()
Returns an array of all of the free machines at the current time.(Machines are numbered starting at 1).

getSchedulableOperations

public java.util.Collection getSchedulableOperations()
Returns a collection of the schedulable operations. (This is a collection of operation objects).

getSchedulableOperations

public java.util.Collection getSchedulableOperations(int machineNumber)
Returns a collection of the schedulable operations for a specific machine. (This is a collection of operation objects).

getTotalFinishedJobs

public int getTotalFinishedJobs()
Returns the total number of finished jobs.

getNumFinishedJobs

public int getNumFinishedJobs(int route)
Returns the number of finsihed jobs on a particular route.

getQMap

public java.util.Map getQMap()
Returns a Map whose keys are operation objects (meaning the queues waiting for each opeartion). And whose values are Integer objects, the values of the map say how many jobs are waiting in each operation Q.

getQPlusMap

public java.util.Map getQPlusMap()
Returns a Map whose keys are operation objects (meaning the queues waiting for each opeartion). And whose values are Integer objects, the values of the map say how jobs are still to pass/complete operation (r,o).

isMachineStarved

public boolean isMachineStarved(int machineNumber)
Returns true if the machine has jobs upstream (as specified in the QPlusMap) and it's buffers are empty.

isMachineDone

public boolean isMachineDone(int machineNumber)
Returns true if the machine does not have anymore jobs left to do in the job shop.

getMachineActivities

public Operation[] getMachineActivities()
Returns an array of Operation objects, with a length the same as the number of machines in the shop. The i'th spot in this array says what machine i+1 is doing. If the spot is null, the machine is idle. If the spot has an operation object the machine is doing that operation.

getInitialNr

public int[] getInitialNr()
Returns the initial number of jobs on each route.

getExpectedProcessingTime

public double getExpectedProcessingTime(int machine)
Uses the getInitialNr result and the means in the shop data to calcualte how much time a machine is expected to process.

getExpectedProcessingTimes

public double[] getExpectedProcessingTimes()
Returns an array with the expectedProcssing time for each machine.

getExpectedMachineLowerBound

public double getExpectedMachineLowerBound()
Returns the maximum of getExpectedProcessingTimes().

addShopChangeListener

public void addShopChangeListener(ShopChangeListener scl)
Register a listener to the state.