org.powertac.officecomplexcustomer.customers
Class Office

java.lang.Object
  extended by 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
protected static org.apache.log4j.Logger log
          logger for trace logging -- use log.info(), log.warn(), and log.error() appropriately.
 OfficeComplex officeOf
          This variable is pointing to the village that this office is part of.
 
Constructor Summary
Office()
           
 
Method Summary
 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.
 Vector<Appliance> getAppliances()
          This is a function that returns the appliances of the office.
 Vector<Person> getMembers()
          This is a function that returns the members of the office.
 void initialize(String OfficeName, Properties conf, Vector<Integer> publicVacationVector, Random gen)
          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 Detail

log

protected static org.apache.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 village that this office is part of.

Constructor Detail

Office

public Office()
Method Detail

initialize

public void initialize(String OfficeName,
                       Properties conf,
                       Vector<Integer> publicVacationVector,
                       Random gen)
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 -
gen -

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.


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:

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:

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:
quarter -
Returns:

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:
quarter -
Returns:

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:
quarter -
Returns:

isEmpty

public boolean isEmpty(int weekday,
                       int quarter)
This function checks if any of the workers is in the office.

Parameters:
weekday -
quarter -
Returns:

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:

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:

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:

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:
weekday -

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Power TAC. All Rights Reserved.