edu.berkeley.io.context.home
Class TemperatureSimulatorGenerator

java.lang.Object
  extended byjava.util.TimerTask
      extended byedu.berkeley.io.context.home.TemperatureSimulatorGenerator
All Implemented Interfaces:
java.lang.Runnable, context.widgets.WTemperature.Generator

public class TemperatureSimulatorGenerator
extends java.util.TimerTask
implements context.widgets.WTemperature.Generator

Author:
alann

Field Summary
protected  java.lang.String currentStatus
           
protected  double currentTemp
           
static int DEFAULT_INIT_HI_TEMPERATURE
           
static int DEFAULT_INIT_LO_TEMPERATURE
           
static int DEFAULT_UPDATE_PERIOD
           
protected  double effRate
           
protected  double eqRate
           
static java.lang.String FAHRENHEIT
           
protected  double hiBaseTemp
           
protected  double hysteresisRange
           
protected  double loBaseTemp
           
protected  TemperatureData tempData
           
protected  context.widgets.WTemperature tempWidget
           
protected  double timeRate
           
protected  int timestep
           
protected  int updatePeriod
           
 
Constructor Summary
TemperatureSimulatorGenerator(int loTemp, int hiTemp, int updatePeriod, context.widgets.WTemperature tempWidget)
           
TemperatureSimulatorGenerator(context.widgets.WTemperature tempWidget)
           
 
Method Summary
protected  double getBase(int time)
           
static void main(java.lang.String[] args)
           
 void run()
           
protected  void setCurrentTemperature()
          this is rough approximation of how a real temperature system would behave.
 void setStatus(java.lang.String status)
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INIT_LO_TEMPERATURE

public static final int DEFAULT_INIT_LO_TEMPERATURE
See Also:
Constant Field Values

DEFAULT_INIT_HI_TEMPERATURE

public static final int DEFAULT_INIT_HI_TEMPERATURE
See Also:
Constant Field Values

DEFAULT_UPDATE_PERIOD

public static final int DEFAULT_UPDATE_PERIOD
See Also:
Constant Field Values

FAHRENHEIT

public static final java.lang.String FAHRENHEIT
See Also:
Constant Field Values

updatePeriod

protected int updatePeriod

timestep

protected int timestep

tempWidget

protected context.widgets.WTemperature tempWidget

tempData

protected TemperatureData tempData

currentStatus

protected java.lang.String currentStatus

hiBaseTemp

protected double hiBaseTemp

loBaseTemp

protected double loBaseTemp

currentTemp

protected double currentTemp

timeRate

protected double timeRate

eqRate

protected double eqRate

effRate

protected double effRate

hysteresisRange

protected double hysteresisRange
Constructor Detail

TemperatureSimulatorGenerator

public TemperatureSimulatorGenerator(context.widgets.WTemperature tempWidget)

TemperatureSimulatorGenerator

public TemperatureSimulatorGenerator(int loTemp,
                                     int hiTemp,
                                     int updatePeriod,
                                     context.widgets.WTemperature tempWidget)
Parameters:
updatePeriod - l
tempWidget -
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
TimerTask.run()

setCurrentTemperature

protected void setCurrentTemperature()
this is rough approximation of how a real temperature system would behave.

Returns:
int

getBase

protected double getBase(int time)

setStatus

public void setStatus(java.lang.String status)
Specified by:
setStatus in interface context.widgets.WTemperature.Generator

main

public static void main(java.lang.String[] args)
Parameters:
args - expects 2 arguments, the location name and the port