haifa.shopsim.lab
Class ShopStatistics

java.lang.Object
  |
  +--haifa.shopsim.lab.ShopStatistics
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RichShopStatistics

public class ShopStatistics
extends java.lang.Object
implements java.io.Serializable

This object is the result of an observation of a shop simulation run. It holds the data that describes the manner in which the run occured. This data is then to be analyzed. The object offers methods for updating the data. These methods are to be used by a StatisticsCollector object. Note that a ShopStatistics object maybe in a sealed state meanning that it is not changable anymore. Currently, the changing methods do not inforce this state.

The pieces of infomration that this object holds are:

This information is not minimal, but it doesn't hurt to much to store all of it (good for debugging.) Note:

Version:
0.60
See Also:
Serialized Form

Field Summary
protected  boolean finished
          true when the job shop is finished and this object is not to be changed any more.
protected  double[] finishTimes
          The completion time of each machine (when it doesn't have material upstream.
protected  double flowTime
          The flow time.
protected  int I
          The number of machines in the shop.
protected  long numSimulationEvents
          The number of simulation events were fired
protected  double[] restForGoodTimes
          The time during which a machine was resting because it was finished.
protected  double[] restTimes
          The times during which each machine rests.
protected  long serialNum
          Gets the unique serial number (unique per JVM).
protected static long serialNumCounter
          A serial number counter of the shopStatistics run.
protected  double[] starveTimes
          The times during which each machine has material up stream but isn't working.
protected  double[] willingRestTimes
          The time during which each machine had a job but was willing to rest.
protected  double[] workTimes
          The times during which each machine is working.
 
Constructor Summary
ShopStatistics(int I_)
          Creates new ShopStatatistics for a given number of machines.
 
Method Summary
 double[] getFinishTimes()
          Returns a reference to the finsih times array.
 double getFlowTime()
          Returns the total flow time.
 int[] getLastWorkingMachines()
          Get the array of Last working machine indexs (indexes start at 1).
 double getMakeSpan()
          Returns the makespan.
 int[] getMostWorkingMachines()
          Get the array of most working machine indexes (indexs start at 1), (this may often be one machine.
 double[] getRestForGoodTimes()
          Returns a reference to the restForGoodTimes array.
 double[] getRestTimes()
          Returns a reference to the resttimes array.
 double[] getStarveTimes()
          Returns a reference to the starve times array.
 double[] getWillingRestTimes()
          Returns a reference to the willing rest times array.
 double[] getWorkTimes()
          Returns a reference to the work times array.
 void incEvents()
          Increments the count of number of simulation events.
 void increaseFlowTime(double delta)
          Increases the flowtime by delta.
 void increaseRestForGoodTime(int machineNum, double delta)
          Increases the rest for good time of a machine.
 void increaseRestTime(int machineNum, double delta)
          Increases the rest time of a machine.
 void increaseStarveTime(int machineNum, double delta)
          Increases the starve time of a machine.
 void increaseWillingRestTime(int machineNum, double delta)
          Increases the willing rest time of a machine.
 void increaseWorkTime(int machineNum, double delta)
          Increases the work time of a machine.
 boolean isComplete()
          Returns true if the statistics object is sealed.
 void maybeSetFinishTime(int machineNum, double finishTime)
          Updates the finish time of a machine if it still hasn't been updated (if it hasn't registered as finished yet.)
 void seal()
          Tell the shop statistics that there is no more incoming information.
 void setFinishTime(int machineNum, double finishTime)
          Sets the finish time for a machine.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

serialNumCounter

protected static long serialNumCounter
A serial number counter of the shopStatistics run. (The first run of a JVM has serial number 1).

serialNum

protected long serialNum
Gets the unique serial number (unique per JVM).

I

protected int I
The number of machines in the shop.

finishTimes

protected double[] finishTimes
The completion time of each machine (when it doesn't have material upstream.

workTimes

protected double[] workTimes
The times during which each machine is working.

restTimes

protected double[] restTimes
The times during which each machine rests.

starveTimes

protected double[] starveTimes
The times during which each machine has material up stream but isn't working.

willingRestTimes

protected double[] willingRestTimes
The time during which each machine had a job but was willing to rest.

restForGoodTimes

protected double[] restForGoodTimes
The time during which a machine was resting because it was finished.

flowTime

protected double flowTime
The flow time.

finished

protected boolean finished
true when the job shop is finished and this object is not to be changed any more.

numSimulationEvents

protected long numSimulationEvents
The number of simulation events were fired
Constructor Detail

ShopStatistics

public ShopStatistics(int I_)
Creates new ShopStatatistics for a given number of machines.
Method Detail

toString

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

incEvents

public void incEvents()
Increments the count of number of simulation events.

setFinishTime

public void setFinishTime(int machineNum,
                          double finishTime)
Sets the finish time for a machine.

maybeSetFinishTime

public void maybeSetFinishTime(int machineNum,
                               double finishTime)
Updates the finish time of a machine if it still hasn't been updated (if it hasn't registered as finished yet.)

increaseWorkTime

public void increaseWorkTime(int machineNum,
                             double delta)
Increases the work time of a machine.

increaseRestTime

public void increaseRestTime(int machineNum,
                             double delta)
Increases the rest time of a machine.

increaseStarveTime

public void increaseStarveTime(int machineNum,
                               double delta)
Increases the starve time of a machine.

increaseRestForGoodTime

public void increaseRestForGoodTime(int machineNum,
                                    double delta)
Increases the rest for good time of a machine.

increaseWillingRestTime

public void increaseWillingRestTime(int machineNum,
                                    double delta)
Increases the willing rest time of a machine.

increaseFlowTime

public void increaseFlowTime(double delta)
Increases the flowtime by delta.

seal

public void seal()
Tell the shop statistics that there is no more incoming information.

isComplete

public boolean isComplete()
Returns true if the statistics object is sealed.

getMakeSpan

public double getMakeSpan()
Returns the makespan.

getFlowTime

public double getFlowTime()
Returns the total flow time.

getLastWorkingMachines

public int[] getLastWorkingMachines()
Get the array of Last working machine indexs (indexes start at 1).

getMostWorkingMachines

public int[] getMostWorkingMachines()
Get the array of most working machine indexes (indexs start at 1), (this may often be one machine.

getWorkTimes

public double[] getWorkTimes()
Returns a reference to the work times array.

getStarveTimes

public double[] getStarveTimes()
Returns a reference to the starve times array.

getFinishTimes

public double[] getFinishTimes()
Returns a reference to the finsih times array.

getRestTimes

public double[] getRestTimes()
Returns a reference to the resttimes array.

getWillingRestTimes

public double[] getWillingRestTimes()
Returns a reference to the willing rest times array.

getRestForGoodTimes

public double[] getRestForGoodTimes()
Returns a reference to the restForGoodTimes array.