00001
00002
00003
00004 #ifndef _RESTORATION_H
00005 #define _RESTORATION_H
00006
00007 #include "powerflow.h"
00008 #include "powerflow_library.h"
00009
00010 #define CONN_NONE 0 //No connectivity
00011 #define CONN_LINE 1 //Normal "line" - OH, UH, Triplex, transformer
00012 #define CONN_FUSE 2 //Fuse connection
00013 #define CONN_SWITCH 3 //Switch connection - controllable via "status"
00014 #define CONN_XFRM 4 //Transformer connection or regulator
00015
00016 typedef struct {
00017 int *Data;
00018 unsigned int DataLength;
00019 unsigned int IdxVar;
00020 } VECTARRAY;
00021
00022 class restoration : public powerflow_library
00023 {
00024 public:
00025 static CLASS *oclass;
00026 static CLASS *pclass;
00027 public:
00028 int **Connectivity_Matrix;
00029
00030 unsigned int reconfig_switch_number;
00031 unsigned int reconfig_attempts;
00032 unsigned int reconfig_iter_limit;
00033 unsigned int reconfig_number;
00034 unsigned int reconfig_iterations;
00035 unsigned int feeder_number;
00036 unsigned int sub_transmission_node;
00037 bool populate_tree;
00038
00039 restoration(MODULE *mod);
00040 inline restoration(CLASS *cl=oclass):powerflow_library(cl){};
00041 int create(void);
00042 int init(OBJECT *parent=NULL);
00043 int isa(char *classname);
00044 void CreateConnectivity(void);
00045 void PopulateConnectivity(int frombus, int tobus, OBJECT *linkingobj);
00046 void Perform_Reconfiguration(OBJECT *faultobj, TIMESTAMP t0);
00047 void Feeder_id_Mark(int initial_node, int feeder);
00048 int Search_sec_switches(int initial_node);
00049 bool VoltageCheck(double MagV_PU);
00050 double VoltagePerUnit(int node_id, int node_phase);
00051 bool connected_path(unsigned int node_int, unsigned int node_end, unsigned int last_node);
00052
00053 private:
00054 TIMESTAMP prev_time;
00055 double *min_V;
00056 double max_V;
00057 int *node_id_minV;
00058 int node_id_maxV;
00059 int *feeder_id;
00060 int *candidate_sec_switch;
00061 bool *visited_flag;
00062 int *unsupported_node;
00063 int *tie_switch;
00064 int *sec_switch;
00065 bool VoltageCheckResult;
00066 int *feeder_initial_node;
00067 };
00068
00069 #endif // _RESTORATION_H