|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Supplier
CS 537, Fall 2002, Project 3. A supplier of energy resources.
Copyright © 2002 by Marvin Solomon. All rights reserved.
Field Summary | |
private int |
iterations
Number of times to iterate before terminating. |
private int[] |
maxSupply
Maximum amount of each commodity to supply on each iteration. |
private int |
meanSleepTime
Mean time to sleep between iterations (in milliseconds). |
private Random |
rand
Source of random numbers. |
private int[] |
supplied
Amount supplied. |
private Trader |
trader
The trader to supply. |
Fields inherited from interface Enron |
cname, COAL, COMMODITIES, cunit, ELEC, GAS, OIL |
Constructor Summary | |
Supplier(Trader trader,
int iterations)
Creates a new supplier. |
Method Summary | |
private static void |
pl(Object o)
Abbreviation for System.out.println. |
void |
run()
Main loop. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Trader trader
private int iterations
private int meanSleepTime
private int[] maxSupply
private Random rand
private int[] supplied
Constructor Detail |
public Supplier(Trader trader, int iterations)
trader
- the trader to supply.Method Detail |
public void run()
run
in interface Runnable
private static void pl(Object o)
o
- the object to be printed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |