/* Copyright 2000 Charles G. Wright * This software may be distributed under the terms of the * GNU General Public License. * * $Id: hvac.java,v 1.1 2000-06-15 10:14:58-05 chuckles Exp chuckles $ */ /** Describes the characteristics of a HVAC system, and provides * related mtehods. */ public class hvac{ private double tc; private double th; private Utility heating_util; private Utility cooling_util; private double heating_cop; private double cooling_cop; /**

Creates an instance of the hvac class, given *

*/ public hvac(double hcop, double ccop, double th, double tc, Utility heating_util, Utility cooling_util){ this.heating_cop = hcop; this.cooling_cop = ccop; this.tc = tc; this.th = th; this.heating_util = heating_util; this.cooling_util = cooling_util; } //---- public methods ------------------------------------ /** Returns the current Coefficient of Performance for heating. */ public double getHeatingCOP(){ return(heating_cop); } /** Sets the current Coefficient of Performance for Heating. */ public void setHeatingCOP(double cop){ heating_cop = cop; } /** Returns the current Coefficient of Performance for * cooling. */ public double getCoolingCOP(){ return(cooling_cop); } /** Sets the current Coefficient of Performance for cooling. */ public void setCoolingCOP(double cop){ cooling_cop = cop; } /** Gets the current thermostat setting (in C) for heating. */ public double getHeatingTemp(){ return(th); } /** Sets the current thermostat for heating. Classes that use * the hvac class should consult this setting when calculating * hvac energy requirements. */ public void setHeatingTemp(int th){ this.th = th; } /** Gets the current thermostat setting (in C) for cooling. */ public double getCoolingTemp(){ return(tc); } /** Sets the current thermostat for cooling. Classes that use * the hvac class should consult this setting when calculating * cooling energy requirements. */ public void setCoolingTemp(int tc){ this.tc = tc; } /** Returns the current heating Utility object. */ public Utility getHeatingUtil(){ return(heating_util); } /** Returns the current cooling Utility object. */ public Utility getCoolingUtil(){ return(cooling_util); } /** Sets the current heating Utility object. */ public void setHeatingUtil(Utility util){ this.heating_util = util; } /** Sets the current cooling Utility object. */ public void setCoolingUtil(Utility util){ this.heating_util = util; } /** Returns the cost (in dollars) of energy used in * heating, based on costs in the current Utility object and * the current type of heat, given the heating requirement, * in kilowatt hours. */ public double getHeatingCost(double kwh){ return(heating_util.getCost(kwh / heating_cop)); } /** Returns the cost (in dollars) of energy used in * cooling, based on costs in the current Utility object and * the current type of heat, given the heating requirement, * in kilowatt hours. */ public double getCoolingCost(double kwh){ return(cooling_util.getCost(kwh / cooling_cop)); } }