units
Class Mine

java.lang.Object
  extended by units.Mine

public class Mine
extends java.lang.Object

This is the abstract mine - which corresponds to the platinum mine in the region.


Nested Class Summary
 class Mine.Record
          Maintain record of mine workers at the mine
 
Field Summary
private  java.util.HashMap<java.lang.Integer,Mine.Record> employeeRecord
          The record of employees at the mine for renumeration purposes
private  boolean functioning
          flag that tells if the mine is currently functioning or has stopped or yet to be started
(package private)  int skilledCapacity
          Number of maximum unskilled workers at the mine at a time
private  java.util.ArrayList<Agent> skilledWorkers
          Skilled workers at the mine
private  int startTick
          The starting month of the mine
private  int stopTick
          The stopping month of the mine
private  java.util.ArrayList<Agent> trainees
          Trainee workers at the mine
private  int trainingStartTick
           
(package private)  int unskilledCapacity
          Number of maximum unskilled workers at the mine at a time
private  java.util.ArrayList<Agent> unSkilledWorkers
          Unskilled workers at the mine
 
Constructor Summary
Mine()
          Creates the mine and register it to the model.
 
Method Summary
private  void employAgent(int currentTick, Agent agent)
          Employ the agent at the currentTick (simulation time step)
 java.util.ArrayList<Agent> getSkilledWorkers()
           
 int getStartTick()
           
 int getStopTick()
           
 java.util.ArrayList<Agent> getTrainees()
           
 int getTrainingStartTick()
           
 java.util.ArrayList<Agent> getUnSkilledWorkers()
           
 void handleJobApplications(int currentTick, java.util.ArrayList<Agent> jobApplicants)
          Handles job applications from the villagers and outsiders
 boolean isFunctioning()
           
 void removeAllWorkers()
          Removes all workers from the mine.
 void removeMineWorker(Agent agent)
          Removes agent from the mine
 int returnEmployeeRenumeration(Agent employee)
          Returns the employess renumeration.
 void setFunctioning(boolean functioning)
           
 void setStartTick(int startTick)
           
 void setStopTick(int stopTick)
           
 void setTrainingStartTick(int trainingStartTick)
           
private  boolean shouldEmploy(Agent agent)
          policy for employing an agent.
 boolean shouldUpgradeWorker(Agent worker)
          Decide if we want to upgrade the status of this mine worker
 void stop()
          Stop the functioning of the mine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

employeeRecord

private java.util.HashMap<java.lang.Integer,Mine.Record> employeeRecord
The record of employees at the mine for renumeration purposes


skilledWorkers

private java.util.ArrayList<Agent> skilledWorkers
Skilled workers at the mine


unSkilledWorkers

private java.util.ArrayList<Agent> unSkilledWorkers
Unskilled workers at the mine


trainees

private java.util.ArrayList<Agent> trainees
Trainee workers at the mine


unskilledCapacity

int unskilledCapacity
Number of maximum unskilled workers at the mine at a time


skilledCapacity

int skilledCapacity
Number of maximum unskilled workers at the mine at a time


startTick

private int startTick
The starting month of the mine


trainingStartTick

private int trainingStartTick

stopTick

private int stopTick
The stopping month of the mine


functioning

private boolean functioning
flag that tells if the mine is currently functioning or has stopped or yet to be started

Constructor Detail

Mine

public Mine()
Creates the mine and register it to the model.

Method Detail

stop

public void stop()
Stop the functioning of the mine


handleJobApplications

public void handleJobApplications(int currentTick,
                                  java.util.ArrayList<Agent> jobApplicants)
Handles job applications from the villagers and outsiders

Parameters:
currentTick: - current simulation month
jobApplicants: - agents applying for the job at the mine

shouldUpgradeWorker

public boolean shouldUpgradeWorker(Agent worker)
Decide if we want to upgrade the status of this mine worker


removeAllWorkers

public void removeAllWorkers()
Removes all workers from the mine.


removeMineWorker

public void removeMineWorker(Agent agent)
Removes agent from the mine

Parameters:
agent -

employAgent

private void employAgent(int currentTick,
                         Agent agent)
Employ the agent at the currentTick (simulation time step)

Parameters:
currentTick -
agent -

returnEmployeeRenumeration

public int returnEmployeeRenumeration(Agent employee)
Returns the employess renumeration.

Parameters:
employee -
Returns:

shouldEmploy

private boolean shouldEmploy(Agent agent)
policy for employing an agent. Depends upon their skills and any other characteristics/backgrounds that might be needed


getSkilledWorkers

public java.util.ArrayList<Agent> getSkilledWorkers()

getUnSkilledWorkers

public java.util.ArrayList<Agent> getUnSkilledWorkers()

getTrainees

public java.util.ArrayList<Agent> getTrainees()

getStartTick

public int getStartTick()

setStartTick

public void setStartTick(int startTick)

getTrainingStartTick

public int getTrainingStartTick()

setTrainingStartTick

public void setTrainingStartTick(int trainingStartTick)

getStopTick

public int getStopTick()

setStopTick

public void setStopTick(int stopTick)

isFunctioning

public boolean isFunctioning()

setFunctioning

public void setFunctioning(boolean functioning)