Advertisement
Guest User

AbstractModel.cpp

a guest
Feb 15th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.30 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////////////////////////////
  2. //! \file       RawModel.hpp
  3. //! \brief      Class header, for AbstractModel implementation
  4. //! \author     Felix Voituret (felix.voituret@univ-avignon.fr)
  5.  
  6. #ifndef ABSTRACT_MODEL_H
  7.  
  8.         #include <ilcplex/ilocplex.h>
  9.         ILOSTBEGIN
  10.         #include <iostream>
  11.         #include <istream>
  12.         #include "type.h"
  13.  
  14.         /*!
  15.                 \class AbstractModel
  16.                 \brief Abstract model class
  17.          */
  18.  
  19.         class AbstractModel : public IloModel {
  20.  
  21.                 public:
  22.  
  23.                         // Constructor          
  24.                         AbstractModel(IloEnv, IloInt, const char * name = 0);
  25.  
  26.  
  27.                         typedef void (AbstractModel::*VectorSetter)(IloInt,IloInt);
  28.                         typedef void (AbstractModel::*MatrixSetter)(IloInt,IloInt,IloInt);
  29.  
  30.                         // Destructor
  31.                         virtual ~AbstractModel() {}
  32.  
  33.                         // Static constraints building methods
  34.                         void buildAssignmentConstraints();
  35.                         void buildPreservationConstraints();
  36.  
  37.                         // Variable setter
  38.                         void setAssignmentCost(IloInt, IloInt);
  39.                         void setBuildingCost(IloInt, IloInt);
  40.                         void setFlow(IloInt ,IloInt, IloInt);
  41.                         void setDistance(IloInt, IloInt, IloInt);
  42.  
  43.                         IloInt getSize() const;
  44.  
  45.                 protected:
  46.  
  47.                         IloInt size;
  48.                    
  49.                         // Numerical value
  50.                         Vector a;               // Installing cost
  51.                         Vector c;               // Building cost
  52.                         Matrix q;               // Flow between activities
  53.                         Matrix d;               // Distance matrix
  54.            
  55.                         // Variable value
  56.                         VariableVector x;       // Assignment variable vector                                  
  57.                         VariableVector y;       // Building variable vector
  58.                         VariableMatrix z;       // Flow variable
  59.         };          
  60.  
  61.         #define ABSTRACT_MODEL_H
  62. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement