org.mars_sim.msp.simulation.person.ai.job
Class JobManager

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.ai.job.JobManager
All Implemented Interfaces:
java.io.Serializable

public final class JobManager
extends java.lang.Object
implements java.io.Serializable

The JobManager class keeps track of the settler jobs in a simulation.

See Also:
Serialized Form

Method Summary
static double getBestJobProspect(Person person, Settlement settlement, boolean isHomeSettlement)
          Gets the best job prospect value for a person at a settlement.
static Job getJob(java.lang.String jobName)
          Gets a job from a job name.
static double getJobProspect(Person person, Job job, Settlement settlement, boolean isHomeSettlement)
          Get the job prospect value for a person and a particular job at a settlement.
static java.util.List<Job> getJobs()
          Gets a list of available jobs in the simulation.
static Job getNewJob(Person person)
          Gets a new job for the person.
static double getRemainingSettlementNeed(Settlement settlement, Job job)
          Gets the need for a job at a settlement minus the capability of the inhabitants performing that job there.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getJobs

public static java.util.List<Job> getJobs()
Gets a list of available jobs in the simulation.

Returns:
list of jobs

getJob

public static Job getJob(java.lang.String jobName)
Gets a job from a job name.

Parameters:
jobName - the name of the job.
Returns:
job or null if job with name not found.

getRemainingSettlementNeed

public static double getRemainingSettlementNeed(Settlement settlement,
                                                Job job)
Gets the need for a job at a settlement minus the capability of the inhabitants performing that job there.

Parameters:
settlement - the settlement to check.
job - the job to check.
Returns:
settlement need minus total job capability of inhabitants with job.

getNewJob

public static Job getNewJob(Person person)
Gets a new job for the person. Might be the person's current job.

Parameters:
person - the person to check.
Returns:
the new job.

getJobProspect

public static double getJobProspect(Person person,
                                    Job job,
                                    Settlement settlement,
                                    boolean isHomeSettlement)
Get the job prospect value for a person and a particular job at a settlement.

Parameters:
person - the person to check for
job - the job to check for
settlement - the settlement to do the job in.
isHomeSettlement - is this the person's home settlement?
Returns:
job prospect value (0.0 min)

getBestJobProspect

public static double getBestJobProspect(Person person,
                                        Settlement settlement,
                                        boolean isHomeSettlement)
Gets the best job prospect value for a person at a settlement.

Parameters:
person - the person to check for
settlement - the settlement to do the job in
isHomeSettlement - is this the person's home settlement?
Returns:
best job prospect value