Enum Class Labour

java.lang.Object
java.lang.Enum<Labour>
simpaths.model.enums.Labour
All Implemented Interfaces:
Serializable, Comparable<Labour>, Constable, microsim.statistics.regression.IntegerValuedEnum

public enum Labour extends Enum<Labour> implements microsim.statistics.regression.IntegerValuedEnum
An enumeration representing different categories of weekly labour supply (work hours) provided by persons.
  • Enum Constant Details

    • ZERO

      public static final Labour ZERO
    • TEN

      public static final Labour TEN
    • TWENTY

      public static final Labour TWENTY
    • THIRTY

      public static final Labour THIRTY
    • THIRTY_EIGHT

      public static final Labour THIRTY_EIGHT
    • FORTY_FIVE

      public static final Labour FORTY_FIVE
    • FIFTY_FIVE

      public static final Labour FIFTY_FIVE
  • Method Details

    • values

      public static Labour[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Labour valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Specified by:
      getValue in interface microsim.statistics.regression.IntegerValuedEnum
    • getRepresentativeHours

      public int getRepresentativeHours()
      This bracket's representative hours, used to score the labour-supply choice.
    • convertHoursToLabour

      public static Labour convertHoursToLabour(int hoursWorked)
      Converts hours worked (int) to the corresponding labour category.
      Parameters:
      hoursWorked - The hours worked.
      Returns:
      The labour category.
    • convertHoursToLabour

      public static Labour convertHoursToLabour(double hoursWorked)
      Converts hours worked (double) to the corresponding labour category.
      Parameters:
      hoursWorked - The hours worked.
      Returns:
      The labour category.
    • getHours

      public int getHours(Person person)
      Gets the hours of work based on the labour category and the person's draw from the uniform distribution. While Parameters.useRepresentativeHoursInUtility is true and the person's labour-supply choice is being evaluated (Person.isEvaluatingLabourChoice), returns this bracket's representative hours, so the choice is scored consistently across persons regardless of their individually drawn hours. Otherwise, if discretized hours are used, returns the representative hours. If continuous hours are used, returns realised hours drawn according to distributionOption, within minBound and maxBound. Note: ZERO category always returns 0 hours of work, irrespective of any of the above.
      Parameters:
      person - The person for whom the hours are calculated.
      Returns:
      The calculated hours of work.