edu.unm.cs.cs351.f10.tdrl.p2
Interface DiscrEventSimulator<S>


public interface DiscrEventSimulator<S>

An interface representing the properties of the computer manufacturer discrete event simulation.

Version:
1.0
Author:
terran

Method Summary
 double getCurrentBalance()
          Get the financial status of the plant.
 int getCurrentTime()
          Returns the current time step of the simulation.
 int getEmployeeCount(EmployeeType t)
          Retrieve the number of employees of the specified type employed by the Grell Computers plant.
 void run(World<S> w, int minutes)
          Run the simulation to completion.
 

Method Detail

getCurrentTime

int getCurrentTime()
Returns the current time step of the simulation. Before the simulation begins, this should return 0; after it completes, this should return t+1, where the simulation ran for t minutes total.

Returns:
Current time of the simulation.

getCurrentBalance

double getCurrentBalance()
Get the financial status of the plant. This returns the current net profit (total incomes-total expenses) of the plant at the current time step. This will be a positive number for a profitable plant, a negative number for a plant that's losing money, and zero for a plant that's just barely breaking even.

Returns:
Current net profit of the plant.

getEmployeeCount

int getEmployeeCount(EmployeeType t)
Retrieve the number of employees of the specified type employed by the Grell Computers plant.

Parameters:
t - Type of employee to query.
Returns:
Count of that type of employee (>=0).

run

void run(World<S> w,
         int minutes)
Run the simulation to completion. This method runs the complete simulation for the specified duration, drawing orders from the specified World object.

Parameters:
w - World object from which to draw orders.
minutes - Number of minutes for which to run the simulation.
Throws:
IllegalArgumentException - if minutes<=0.
NullPointerException - if w==null