|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.mhhe.clrs2e.AssemblyLine
Implementation of assembly-line scheduling for two lines, as described in Section 15.1 of Introduction to Algorithms, Second edition. Because this is Java code, numbering starts from 0, so that the lines are 0 and 1 and station numbers are 0, 1, ..., n-1.
| Field Summary | |
private double[][] |
f
The value of an optimal solution to a subproblem. |
private double |
fStar
The fastest way to get all the way through the factory. |
private int[][] |
l
The station used in an optimal solution to a subproblem. |
private int |
lStar
The line whose station n is used in a fastest way through the factory. |
private int |
n
The number of stations on each line. |
| Constructor Summary | |
AssemblyLine(double[][] a,
double[][] t,
double[] e,
double[] x,
int n)
Computes the fastest way through the factory, allocating the instance variables and storing the result in them. |
|
| Method Summary | |
private void |
fastestWay(double[][] a,
double[][] t,
double[] e,
double[] x,
int n)
Computes the fastest way through the factory, storing the result in the instance variables. |
int[] |
getFastestRoute()
Returns the line numbers used in a fastest way through the factory. |
double |
getFastestTime()
Returns the time taken by the fastest way to get all the way through the factory. |
java.lang.String |
toString()
Returns the String representation of a fastest
way through the factory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private int n
private double[][] f
f[i][j] is the fastest possible time to get from
the starting point through station
Si,j, for i = 0, 1
and j = 0, 1, ..., n-1.
private double fStar
private int[][] l
l[i][j] is the line number whose station precedes
Si,j on a fastest way from the
starting point through station
Si,j, for i = 0, 1
and j = 0, 1, ..., n-1.
private int lStar
| Constructor Detail |
public AssemblyLine(double[][] a,
double[][] t,
double[] e,
double[] x,
int n)
a - a[i][j] is the assembly time at station
Si,j.t - t[i][j] is the time to transfer from one
assembly line to the other after going through station
Si,j.e - e[i] is the entry time for line
i, for i = 0, 1.x - e[i] is the exit time for line
i, for i = 0, 1.n - The number of stations on each line.| Method Detail |
private void fastestWay(double[][] a,
double[][] t,
double[] e,
double[] x,
int n)
a - a[i][j] is the assembly time at station
Si,j.t - t[i][j] is the time to transfer from one
assembly line to the other after going through station
Si,j.e - e[i] is the entry time for line
i, for i = 0, 1.x - e[i] is the exit time for line
i, for i = 0, 1.n - The number of stations on each line.public double getFastestTime()
public int[] getFastestRoute()
r, such that station
Sr[j],j is used in
a fastest way through the factory.public java.lang.String toString()
String representation of a fastest
way through the factory.
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||