java.lang.Object
org.powertac.officecomplexcustomer.customers.Office

public class Office
extends Object
The office is the domain instance represents a single working facility with the workers acting inside it and fully equipped with appliances statistically distributed. There are different kinds of appliances utilized by the persons working in the premises and each person has it's own working and break schedule.
Version:
1.5, Date: 2.25.12
Author:
Antonios Chrysopoulos
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static org.apache.logging.log4j.Logger log
    logger for trace logging -- use log.info(), log.warn(), and log.error() appropriately.
    OfficeComplex officeOf
    This variable is pointing to the OfficeComplex that this office is part of.
  • Constructor Summary

    Constructors 
    Constructor Description
    Office()  
  • Method Summary

    Modifier and Type Method Description
    int employeeNumber​(int weekday, int quarter)
    This function checks the number of employees in the office in a specific quarter, either working either on break.
    int employeeOnBreakNumber​(int weekday, int quarter)
    This function checks the number of employees on a break in the office in a specific quarter.
    int employeeWorkingNumber​(int weekday, int quarter)
    This function checks the number of working employees in the office in a specific quarter.
    void findDominantAppliance()
    This function returns the dominant appliance of the household.
    Vector<Appliance> getAppliances()
    This is a function that returns the appliances of the office.
    Appliance getDominantAppliance()
    This function returns the dominant appliance of the household.
    double getDominantConsumption​(int hour)
    This is a function returning the dominant Consumption Load for a certain hour.
    Vector<Person> getMembers()
    This is a function that returns the members of the office.
    double getNonDominantConsumption​(int hour)
    This is a function returning the non dominant Consumption Load for a certain hour.
    void initialize​(String OfficeName, Properties conf, Vector<Integer> publicVacationVector, int seed)
    This is the initialization function.
    boolean isEmpty​(int weekday, int quarter)
    This function checks if any of the workers is in the office.
    boolean isOnBreak​(int weekday, int quarter)
    This function checks if any of the workers of the office are on break.
    boolean isOnVacation​(int weekday)
    This function checks if all the workers of the office are away on vacation or sick on a certain day
    boolean isWorking​(int weekday, int quarter)
    This function checks if any of the workers in the office are working
    boolean isWorkingDay​(int day)
    This function checks if all the workers of the office are away on vacation or sick on a certain day
    boolean isWorkingDayOfWeek​(int weekday)
    This function checks if all the workers of the office are away on vacation or sick on a certain day
    void printDailyLoad​(int day)
    This function prints to the screen the daily load of the office for the weekday at hand.
    String toString()  
    void weatherCheck​(int day, int hour, org.joda.time.Instant now, double temperature)
    This function is checking the current weather conditions and the existence of weather sensitive appliances and if the temperature is over/under a certain threshold, the appliances begin or stop their operation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • log

      protected static org.apache.logging.log4j.Logger log
      logger for trace logging -- use log.info(), log.warn(), and log.error() appropriately. Use log.debug() for output you want to see in testing or debugging.
    • officeOf

      public OfficeComplex officeOf
      This variable is pointing to the OfficeComplex that this office is part of.
  • Constructor Details

  • Method Details

    • initialize

      public void initialize​(String OfficeName, Properties conf, Vector<Integer> publicVacationVector, int seed)
      This is the initialization function. It uses the variable values for the configuration file to create the office and then fill it with persons and appliances as it seems fit.
      Parameters:
      OfficeName -
      conf -
      publicVacationVector -
      seed -
    • getAppliances

      public Vector<Appliance> getAppliances()
      This is a function that returns the appliances of the office.
    • getMembers

      public Vector<Person> getMembers()
      This is a function that returns the members of the office.
    • getDominantConsumption

      public double getDominantConsumption​(int hour)
      This is a function returning the dominant Consumption Load for a certain hour.
    • getNonDominantConsumption

      public double getNonDominantConsumption​(int hour)
      This is a function returning the non dominant Consumption Load for a certain hour.
    • findDominantAppliance

      public void findDominantAppliance()
      This function returns the dominant appliance of the household.
    • getDominantAppliance

      public Appliance getDominantAppliance()
      This function returns the dominant appliance of the household.
    • isWorking

      public boolean isWorking​(int weekday, int quarter)
      This function checks if any of the workers in the office are working
      Parameters:
      weekday -
      quarter -
      Returns:
      true if any of the workers in the office are working
    • isOnBreak

      public boolean isOnBreak​(int weekday, int quarter)
      This function checks if any of the workers of the office are on break.
      Parameters:
      weekday -
      quarter -
      Returns:
      true if any of the workers of the office are on break
    • isOnVacation

      public boolean isOnVacation​(int weekday)
      This function checks if all the workers of the office are away on vacation or sick on a certain day
      Parameters:
      weekday -
      Returns:
      true all the workers of the office are away on vacation or sick
    • isWorkingDayOfWeek

      public boolean isWorkingDayOfWeek​(int weekday)
      This function checks if all the workers of the office are away on vacation or sick on a certain day
      Parameters:
      weekday -
      Returns:
      true if all the workers of the office are away on vacation or sick
    • isWorkingDay

      public boolean isWorkingDay​(int day)
      This function checks if all the workers of the office are away on vacation or sick on a certain day
      Parameters:
      day -
      Returns:
      boolean if all the workers of the office are away on vacation or sick
    • isEmpty

      public boolean isEmpty​(int weekday, int quarter)
      This function checks if any of the workers is in the office.
      Parameters:
      weekday -
      quarter -
      Returns:
      true if none of the workers are in the office.
    • employeeWorkingNumber

      public int employeeWorkingNumber​(int weekday, int quarter)
      This function checks the number of working employees in the office in a specific quarter.
      Parameters:
      weekday -
      quarter -
      Returns:
      the number of working employees in the office in a specific quarter
    • employeeOnBreakNumber

      public int employeeOnBreakNumber​(int weekday, int quarter)
      This function checks the number of employees on a break in the office in a specific quarter.
      Parameters:
      weekday -
      quarter -
      Returns:
      the number of employees on a break in the office in a specific quarter
    • employeeNumber

      public int employeeNumber​(int weekday, int quarter)
      This function checks the number of employees in the office in a specific quarter, either working either on break.
      Parameters:
      weekday -
      quarter -
      Returns:
      the number of employees in the office in a specific quarter, either working either on break
    • weatherCheck

      public void weatherCheck​(int day, int hour, org.joda.time.Instant now, double temperature)
      This function is checking the current weather conditions and the existence of weather sensitive appliances and if the temperature is over/under a certain threshold, the appliances begin or stop their operation.
    • printDailyLoad

      public void printDailyLoad​(int day)
      This function prints to the screen the daily load of the office for the weekday at hand.
      Parameters:
      day -
    • toString

      public String toString()
      Overrides:
      toString in class Object