00001
00005 #ifndef _NODE_H
00006 #define _NODE_H
00007
00008 #include "link.h"
00009
00010 typedef struct s_linklist {
00011 class link *data;
00012 struct s_linklist *next;
00013 } LINKLIST;
00014
00015 typedef enum {PQ=0, PQV=1, PV=2, SWING=3} BUSTYPE;
00016 class node {
00017 public:
00018 complex V;
00019 complex S;
00020 double G;
00021 double B;
00022 double Qmax_MVAR;
00023 double Qmin_MVAR;
00024 BUSTYPE type;
00025 int16 flow_area_num;
00026 int16 loss_zone_num;
00027 double base_kV;
00028 double desired_kV;
00029 OBJECT *remote_bus_id;
00030 LINKLIST *linklist;
00031
00032
00033 complex Vobs;
00034 double Vstdev;
00035
00036 protected:
00037 complex Ys;
00038 complex YVs;
00039 double r2;
00040 unsigned short n_obs;
00041 double Sr2;
00042 unsigned short n_inj;
00043 public:
00044 static CLASS *oclass;
00045 static node *defaults;
00046 static CLASS *pclass;
00047 public:
00048 node(MODULE *mod);
00049 ~node();
00050 int create();
00051 int init(OBJECT *parent);
00052
00053 void attach(link *pLink);
00054
00055 void add_obs_residual(node *pNode);
00056 void del_obs_residual(node *pNode);
00057 double get_obs_residual(void) const;
00058 double get_obs_probability(void) const;
00059
00060 void add_inj_residual(node *pNode);
00061 void del_inj_residual(node *pNode);
00062 double get_inj_residual(void) const;
00063 double get_inj_probability(void) const;
00064
00065 TIMESTAMP presync(TIMESTAMP t0);
00066 TIMESTAMP postsync(TIMESTAMP t0);
00067 friend class link;
00068 };
00069
00070 GLOBAL CLASS *node_class INIT(NULL);
00071 GLOBAL OBJECT *last_node INIT(NULL);
00072
00073 #endif