Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////////////////////////
- //! \file RawModel.hpp
- //! \brief Class header, for AbstractModel implementation
- //! \author Felix Voituret (felix.voituret@univ-avignon.fr)
- #ifndef ABSTRACT_MODEL_H
- #include <ilcplex/ilocplex.h>
- ILOSTBEGIN
- #include <iostream>
- #include <istream>
- #include "type.h"
- /*!
- \class AbstractModel
- \brief Abstract model class
- */
- class AbstractModel : public IloModel {
- public:
- // Constructor
- AbstractModel(IloEnv, IloInt, const char * name = 0);
- typedef void (AbstractModel::*VectorSetter)(IloInt,IloInt);
- typedef void (AbstractModel::*MatrixSetter)(IloInt,IloInt,IloInt);
- // Destructor
- virtual ~AbstractModel() {}
- // Static constraints building methods
- void buildAssignmentConstraints();
- void buildPreservationConstraints();
- // Variable setter
- void setAssignmentCost(IloInt, IloInt);
- void setBuildingCost(IloInt, IloInt);
- void setFlow(IloInt ,IloInt, IloInt);
- void setDistance(IloInt, IloInt, IloInt);
- IloInt getSize() const;
- protected:
- IloInt size;
- // Numerical value
- Vector a; // Installing cost
- Vector c; // Building cost
- Matrix q; // Flow between activities
- Matrix d; // Distance matrix
- // Variable value
- VariableVector x; // Assignment variable vector
- VariableVector y; // Building variable vector
- VariableMatrix z; // Flow variable
- };
- #define ABSTRACT_MODEL_H
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement