|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectProject3
The Project 3 main class.
Field Summary |
Fields inherited from interface IBM |
GOLD, metalName, METALS, PLATINUM, URANIUM |
Constructor Summary | |
Project3()
|
Method Summary | |
static int |
consumers()
Get the number of consumers. |
static void |
debug(Object message)
Debug print. |
static int |
expo(Random rand,
int mean)
Generate an exponentially distributed random number. |
static void |
main(String[] args)
Main program for project 3. |
static String |
requestToString(int[] req)
Turn a request for resources into a printable string. |
static void |
setVerbose(boolean onOff)
Turn debugging output on or off. |
static int |
time()
Handy procedure for timing. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Project3()
Method Detail |
public static int consumers()
public static void setVerbose(boolean onOff)
onOff
- if true, turn debugging on; otherwise turn it off.public static void debug(Object message)
message
- the message to print.public static int time()
public static String requestToString(int[] req)
req
- an indication of the amount of each metal desired.
"[ng+np+nu] = total"where ng, np, nu, and total are integers.
public static int expo(Random rand, int mean)
rand
- the source of random numbers.mean
- the mean of the distribution.
public static void main(String[] args)
args
- the command-line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |