org.powertac.officecomplexcustomer.appliances
Class Appliance

java.lang.Object
  extended by org.powertac.officecomplexcustomer.appliances.Appliance
Direct Known Subclasses:
CopyMachine, FullyShiftingAppliance, MicrowaveOven, NotShiftingAppliance, WeatherSensitiveAppliance

public class Appliance
extends Object

A appliance domain instance represents a single appliance inside a household. There are different kinds of appliances utilized by the persons inhabiting the premises. Some of them are functioning automatically, some are only used when someone is present etc.

Version:
1.5, Date: 2.25.12
Author:
Antonios Chrysopoulos

Field Summary
protected  Office applianceOf
          The household that the appliance is installed at.
protected  int cycleDuration
          This variable equals the duration of the operation cycle of the appliance.
protected static org.apache.log4j.Logger log
          logger for trace logging -- use log.info(), log.warn(), and log.error() appropriately.
protected  String name
          The appliance name.
protected  int power
          This variable shows the power (in Watts) that are consumed when using this appliance.
protected  double saturation
          This variable shows the possibility (%) that this appliance is contained in a house.
 
Constructor Summary
Appliance()
           
 
Method Summary
 void createWeeklyPossibilityOperationVector()
          This function is used to create the weekly possibility operation vector of each appliance taking into consideration the times that this appliance could be able to function.
 long[] dailyShifting(org.powertac.common.Tariff tariff, org.joda.time.Instant now, int day, Random gen)
          This is a complex function that changes the appliance's function in order to have the most cost effective operation load in a day schedule.
 void fillDailyOperation(int times, Random gen)
          This function fills out all the quarters of the appliance functions for a single day of the week.
 void fillWeeklyOperation(Random gen)
          This function fills out all the days of the appliance functions for each day of the week.
 Office getApplianceOf()
          This function returns the household where the appliance is installed.
 int getDuration()
          This function returns the duration variable of the appliance.
 int getPower()
          This function returns the power variable of the appliance.
 double getSaturation()
          This function returns the saturation variable of the appliance.
 Vector<Vector<Integer>> getWeeklyLoadVector()
          This function returns the weekly load vector of the appliance.
 Vector<Vector<Boolean>> getWeeklyOperation()
          This function returns the weekly operation vector of the appliance.
 void initialize(String office, Properties conf, Random gen)
          This is the initialization function.
 void refresh(Random gen)
          At the end of each week the appliance models refresh their schedule.
 void setApplianceOf(Office office)
          This function sets the household in which the appliance is installed in.
 void setOperationDays()
          This is an function to fill the maps utilized by Services in order to keep the vectors of each appliance during the runtime.
 void showStatus()
          This is the function utilized to show the information regarding the appliance in question, its variables values etc.
 String toString()
           
 void weatherDailyFunction(int day, int hour, double temp)
          This function fills out the daily function of an appliance for the day.
 
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.


name

protected String name
The appliance name. Appliances are named after the type of appliance and the household that contains it.


applianceOf

protected Office applianceOf
The household that the appliance is installed at.


saturation

protected double saturation
This variable shows the possibility (%) that this appliance is contained in a house.


power

protected int power
This variable shows the power (in Watts) that are consumed when using this appliance.


cycleDuration

protected int cycleDuration
This variable equals the duration of the operation cycle of the appliance.

Constructor Detail

Appliance

public Appliance()
Method Detail

getPower

public int getPower()
This function returns the power variable of the appliance.


getApplianceOf

public Office getApplianceOf()
This function returns the household where the appliance is installed.


getSaturation

public double getSaturation()
This function returns the saturation variable of the appliance.


getDuration

public int getDuration()
This function returns the duration variable of the appliance.


getWeeklyOperation

public Vector<Vector<Boolean>> getWeeklyOperation()
This function returns the weekly operation vector of the appliance.


getWeeklyLoadVector

public Vector<Vector<Integer>> getWeeklyLoadVector()
This function returns the weekly load vector of the appliance.


setApplianceOf

public void setApplianceOf(Office office)
This function sets the household in which the appliance is installed in.


createWeeklyPossibilityOperationVector

public void createWeeklyPossibilityOperationVector()
This function is used to create the weekly possibility operation vector of each appliance taking into consideration the times that this appliance could be able to function.


initialize

public void initialize(String office,
                       Properties conf,
                       Random gen)
This is the initialization function. It uses the variable values for the configuration file to create the appliance as it should for this type.

Parameters:
household -
conf -
gen -

dailyShifting

public long[] dailyShifting(org.powertac.common.Tariff tariff,
                            org.joda.time.Instant now,
                            int day,
                            Random gen)
This is a complex function that changes the appliance's function in order to have the most cost effective operation load in a day schedule.

Parameters:
gen -
tariff -
now -
day -
Returns:

fillDailyOperation

public void fillDailyOperation(int times,
                               Random gen)
This function fills out all the quarters of the appliance functions for a single day of the week.

Parameters:
gen -

fillWeeklyOperation

public void fillWeeklyOperation(Random gen)
This function fills out all the days of the appliance functions for each day of the week.

Parameters:
gen -

showStatus

public void showStatus()
This is the function utilized to show the information regarding the appliance in question, its variables values etc.


weatherDailyFunction

public void weatherDailyFunction(int day,
                                 int hour,
                                 double temp)
This function fills out the daily function of an appliance for the day.


refresh

public void refresh(Random gen)
At the end of each week the appliance models refresh their schedule. This way we have a realistic and dynamic model, changing function hours, consuming power and so on.

Parameters:
conf -
gen -

setOperationDays

public void setOperationDays()
This is an function to fill the maps utilized by Services in order to keep the vectors of each appliance during the runtime.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Power TAC. All Rights Reserved.