SDPUC_Instance.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the Decomp Solver Framework.                         //
00003 //                                                                           //
00004 // Decomp is distributed under the Common Public License as part of the      //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, Lehigh University                                 //
00008 //                                                                           //
00009 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
00011 //===========================================================================//
00012 
00013 #ifndef SDPUC_INSTANCE_INCLUDED
00014 #define SDPUC_INSTANCE_INCLUDED
00015 
00016 //===========================================================================//
00017 #include "UtilMacros.h"
00018 //===========================================================================//
00019 class SDPUC_Param;
00020 using namespace std;
00021 //===========================================================================//
00022 
00023 //===========================================================================//
00036 //===========================================================================//
00037 class SDPUC_Instance {
00038 public:
00040    struct arc {
00041       int    tail;
00042       int    head;
00043       double lb;
00044       double ub;
00045       double weight; //e.g. reactance
00046       double mcost;  //marginal cost
00047       double fcost1; //arc installation cost
00048       double fcost2; //switch installation cost
00049       int    tscap;
00050       int    tscost;
00051       int    acline;  // arc is included in kirchoffs constraints (set to 0 for supply and hvdc-arcs)
00052       int    switchable;  // arc is switchable
00053    };
00054    struct node {
00055       int      id;
00056       double   demand;
00057       int      tsdemand;
00058    };   
00059    struct timeseries {
00060       int    id;
00061       double * values;
00062    };
00063    string       m_problemName;
00064    arc          * m_arcs;
00065    node         * m_nodes;
00066    timeseries   * m_timeseries;
00067    int          m_numNodes;
00068    int          m_numArcs;
00069    int          m_numTimeseries;
00070    int          m_numTimeperiods;
00071    int          m_numSwitchings;    // max. no. of simultaneously employed switches
00072 
00073 public:
00075    int readInstance(string & fileName,
00076                     bool     addDummyArcs = true);
00077 
00078    inline void initMembers(){
00079       m_problemName     = "";
00080       m_arcs            = NULL;
00081       m_nodes           = NULL;
00082       m_numNodes        = 0;
00083       m_numArcs         = 0;
00084       m_numTimeseries   = 0;
00085       m_numTimeperiods  = 0;
00086       m_numSwitchings   = 0;
00087    }
00088 
00089 public:
00093    SDPUC_Instance(){
00094       initMembers();
00095    };
00096    
00098    SDPUC_Instance(string & fileName) {
00099       initMembers();
00100       readInstance(fileName);
00101    }
00102    
00104    ~SDPUC_Instance() {
00105       UTIL_DELARR(m_arcs);
00106       UTIL_DELARR(m_nodes);
00107       UTIL_DELARR(m_timeseries);
00108    };
00109 };
00110 
00111 #endif

Generated on 5 Apr 2015 for Dip-All by  doxygen 1.6.1