00001 00005 #ifndef _APPLIANCE_H 00006 #define _APPLIANCE_H 00007 00008 #include "residential_enduse.h" 00009 00010 class appliance : public residential_enduse 00011 { 00012 private: 00013 GL_STRUCT(complex_array,power); 00014 GL_STRUCT(complex_array,impedance); 00015 GL_STRUCT(complex_array,current); 00016 GL_STRUCT(double_array,duration); 00017 GL_STRUCT(double_array,transition); 00018 GL_STRUCT(double_array,heatgain); 00019 private: 00020 TIMESTAMP next_t; 00021 unsigned int n_states; 00022 unsigned int state; 00023 double *transition_probabilities; 00024 private: 00025 void update_next_t(void); 00026 void update_power(void); 00027 void update_state(void); 00028 public: 00029 appliance(MODULE *module); 00030 ~appliance(); 00031 int create(); 00032 int init(OBJECT *parent); 00033 int isa(char *classname); 00034 int precommit(TIMESTAMP t1); 00035 inline TIMESTAMP presync(TIMESTAMP t1); 00036 TIMESTAMP sync(TIMESTAMP t1) { return TS_NEVER; }; 00037 inline TIMESTAMP postsync(TIMESTAMP t1) { return TS_NEVER; }; 00038 int prenotify(PROPERTY *prop, char *value){ return 1;} ; 00039 int postnotify(PROPERTY *prop, char *value); 00040 public: 00041 static CLASS *oclass, *pclass; 00042 static appliance *defaults; 00043 }; 00044 00045 #endif