Class Refiner

Object
  extended byRefiner
All Implemented Interfaces:
IBM, Runnable

public class Refiner
extends Object
implements Runnable, IBM

CS 537, Spring 2004, Project 2. A refiner of various metals.


Field Summary
 
Fields inherited from interface IBM
GOLD, metalName, METALS, PLATINUM, URANIUM
 
Constructor Summary
Refiner(int iterations)
          Creates a new refiner.
 
Method Summary
 void getProduction(int[] amt)
          Indicates the amount of each resource delivered.
 void run()
          Main loop.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Refiner

public Refiner(int iterations)
Creates a new refiner.

Parameters:
iterations - the number of times to iterate before terminating.
Method Detail

getProduction

public void getProduction(int[] amt)
Indicates the amount of each resource delivered.

Parameters:
amt - a vector of amounts allocated by the caller and filled in here with the total amounts delivered thus far.

run

public void run()
Main loop. Repeatedly generates orders to random brokers. After iterations iterations, sleeps for three seconds and then kills the entire program.

Specified by:
run in interface Runnable