00001
00010 #ifndef _EVCHARGER_H
00011 #define _EVCHARGER_H
00012
00013 #include "residential.h"
00014 #include "residential_enduse.h"
00015
00016 #define MAXDAYTYPES 2
00017 #define WEEKDAY 0
00018 #define WEEKEND 1
00019
00020 #define MAXEVENTS 2
00021 #define DEPART 0
00022 #define ARRIVE 1
00023
00024 typedef struct s_evdemand {
00025 char name[1024];
00026 unsigned short n_daytypes;
00027 double home[MAXDAYTYPES][MAXEVENTS][24];
00028 double work[MAXDAYTYPES][MAXEVENTS][24];
00029 double shorttrip[MAXDAYTYPES][MAXEVENTS][24];
00030 double longtrip[MAXDAYTYPES][MAXEVENTS][24];
00031 } EVDEMAND;
00032
00033 class evcharger : public residential_enduse
00034 {
00035 typedef enum {
00036 VS_UNKNOWN=-1,
00037 VS_HOME=0,
00038 VS_WORK=1,
00039
00040
00041
00042 } VEHICLESTATE;
00043 typedef enum {
00044 CT_LOW=0,
00045 CT_MEDIUM=1,
00046 CT_HIGH=2,
00047 } CHARGERTYPE;
00048 typedef enum {
00049 VT_ELECTRIC=0,
00050 VT_HYBRID=1,
00051 } VEHICLETYPE;
00052 private:
00053 EVDEMAND *pDemand;
00054
00055 public:
00056 double heat_fraction;
00057 enumeration charger_type;
00058 enumeration vehicle_type;
00059 enumeration vehicle_state;
00060 double charging_efficiency;
00061 struct {
00062 double home;
00063 double work;
00064
00065
00066
00067 } demand;
00068 struct {
00069 double work;
00070
00071
00072
00073 } distance;
00074 bool charge_at_work;
00075 double capacity;
00076 double charge;
00077 double mileage;
00078 double power_factor;
00079 double charge_throttle;
00080 double mileage_classification;
00081 char1024 demand_profile;
00082
00083 public:
00084 static CLASS *oclass, *pclass;
00085 static evcharger *defaults;
00086
00087 evcharger(MODULE *module);
00088 ~evcharger();
00089 int create();
00090 int init(OBJECT *parent);
00091 int isa(char *classname);
00092 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00093 double update_state(double dt=0.0);
00094 void load_demand_profile();
00095 };
00096
00097 #endif // _EVCHARGER_H
00098