|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunits.Mine
public class Mine
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 |
---|
private java.util.HashMap<java.lang.Integer,Mine.Record> employeeRecord
private java.util.ArrayList<Agent> skilledWorkers
private java.util.ArrayList<Agent> unSkilledWorkers
private java.util.ArrayList<Agent> trainees
int unskilledCapacity
int skilledCapacity
private int startTick
private int trainingStartTick
private int stopTick
private boolean functioning
Constructor Detail |
---|
public Mine()
Method Detail |
---|
public void stop()
public void handleJobApplications(int currentTick, java.util.ArrayList<Agent> jobApplicants)
currentTick:
- current simulation monthjobApplicants:
- agents applying for the job at the minepublic boolean shouldUpgradeWorker(Agent worker)
public void removeAllWorkers()
public void removeMineWorker(Agent agent)
agent
- private void employAgent(int currentTick, Agent agent)
currentTick
- agent
- public int returnEmployeeRenumeration(Agent employee)
employee
-
private boolean shouldEmploy(Agent agent)
public java.util.ArrayList<Agent> getSkilledWorkers()
public java.util.ArrayList<Agent> getUnSkilledWorkers()
public java.util.ArrayList<Agent> getTrainees()
public int getStartTick()
public void setStartTick(int startTick)
public int getTrainingStartTick()
public void setTrainingStartTick(int trainingStartTick)
public int getStopTick()
public void setStopTick(int stopTick)
public boolean isFunctioning()
public void setFunctioning(boolean functioning)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |