Dip  0.92.4
SDPUC_Instance.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9 // Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10 // //
11 // Copyright (C) 2002-2019, Lehigh University, Matthew Galati, and Ted Ralphs//
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 #ifndef SDPUC_INSTANCE_INCLUDED
16 #define SDPUC_INSTANCE_INCLUDED
17 
18 //===========================================================================//
19 #include "UtilMacros.h"
20 //===========================================================================//
21 class SDPUC_Param;
22 using namespace std;
23 //===========================================================================//
24 
25 //===========================================================================//
38 //===========================================================================//
40 public:
42  struct arc {
43  int tail;
44  int head;
45  double lb;
46  double ub;
47  double weight; //e.g. reactance
48  double mcost; //marginal cost
49  double fcost1; //arc installation cost
50  double fcost2; //switch installation cost
51  int tscap;
52  int tscost;
53  int acline; // arc is included in kirchoffs constraints (set to 0 for supply and hvdc-arcs)
54  int switchable; // arc is switchable
55  };
56  struct node {
57  int id;
58  double demand;
59  int tsdemand;
60  };
61  struct timeseries {
62  int id;
63  double * values;
64  };
65  string m_problemName;
70  int m_numArcs;
73  int m_numSwitchings; // max. no. of simultaneously employed switches
74 
75 public:
77  int readInstance(string & fileName,
78  bool addDummyArcs = true);
79 
80  inline void initMembers(){
81  m_problemName = "";
82  m_arcs = NULL;
83  m_nodes = NULL;
84  m_numNodes = 0;
85  m_numArcs = 0;
86  m_numTimeseries = 0;
87  m_numTimeperiods = 0;
88  m_numSwitchings = 0;
89  }
90 
91 public:
96  initMembers();
97  };
98 
100  SDPUC_Instance(string & fileName) {
101  initMembers();
102  readInstance(fileName);
103  }
104 
107  UTIL_DELARR(m_arcs);
108  UTIL_DELARR(m_nodes);
109  UTIL_DELARR(m_timeseries);
110  };
111 };
112 
113 #endif
SDPUC_Instance()
Default constructor.
~SDPUC_Instance()
Default destructor.
SDPUC_Instance(string &fileName)
Default constructor.
#define UTIL_DELARR(x)
Definition: UtilMacros.h:29
string m_problemName
SDPUC_Instance problem instance data.
timeseries * m_timeseries