<commit_before>/*===========================================================================*
 * This file is part of a solver for the Vehicle Routing Problem             *
 * developed using the BiCePS Linear Integer Solver (BLIS).                  *
 *                                                                           *
 * This solver is distributed under the Common Public License as part of     * 
 * the COIN-OR repository (http://www.coin-or.org).                          *
 *                                                                           *
 * Authors: <NAME>, Lehigh University                                        *
 *          <NAME>, Lehigh University                                    *
 *                                                                           *
 * Copyright (C) 2007 <NAME> and <NAME>.                                 *
 * All Rights Reserved.                                                      *
 *===========================================================================*/

#ifndef VrpModel_h_
#define VrpModel_h_

//#############################################################################

#include <vector>

#include "BlisModel.h"
#include "VrpVariable.h"
#include "VrpCommonTypes.h"
#include "VrpConstants.h"
#include "VrpParams.h"
#include "VrpCutGenerator.h"

//#############################################################################

/** Model class for VRP. */
class VrpModel : public BlisModel 
{    

   friend class VrpCutGenerator;
   
 private:

   char name_[100];
   int vertnum_;
   int edgenum_;
   int numroutes_;
   int depot_;
   int capacity_;
   int wtype_;
   int *demand_;    /*vertnum_*/
   int *posx_;      /*vertnum_*/
   int *posy_;      /*vertnum_*/
   double *coordx_; /*vertnum_*/
   double *coordy_; /*vertnum_*/
   double *coordz_; /*vertnum_*/
   double etol_;

   VrpParams *VrpPar_;
   VrpNetwork *n_;  /* Allocate when readInstance */
   
   // edges_ hold the same elements as variables_ does, do not free memory.
   // For parallel, reinsert elements in variables_ to edges_
   std::vector<VrpVariable *> edges_;

   // Do we need this? Solution?
   std::vector<best_tours> curTour_;

protected:

   /** 1) Set colMatrix_, varLB_, varUB_, conLB_, conUB, numCols_, numRows_
    *  2) Set objCoef_ and objSense_
    *  3) Set colType_ ('C', 'I', or 'B')
    */
   void setModelData();
   
public:

    /** Default construtor. */
   VrpModel() : vertnum_(0), edgenum_(0), numroutes_(0), depot_(0),
      capacity_(0), wtype_(0), etol_(1e-5){
      demand_ = 0;
      posx_ = 0;
      posy_ = 0;
      coordx_ = 0;
      coordy_ = 0;
      coordz_ = 0;
      n_ = 0;
      VrpPar_ = new VrpParams;
      BlisPar()->setEntry(BlisParams::cutClique,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutFlowCover,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutGomory,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutKnapsack,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutMir,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutOddHole,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutProbing,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutTwoMir,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::heurRound,BLIS_NONE);<commit_msg>strategy to best-first<commit_after>/*===========================================================================*
 * This file is part of a solver for the Vehicle Routing Problem             *
 * developed using the BiCePS Linear Integer Solver (BLIS).                  *
 *                                                                           *
 * This solver is distributed under the Common Public License as part of     * 
 * the COIN-OR repository (http://www.coin-or.org).                          *
 *                                                                           *
 * Authors: <NAME>, Lehigh University                                        *
 *          <NAME>, Lehigh University                                    *
 *                                                                           *
 * Copyright (C) 2007 <NAME> and <NAME>.                                 *
 * All Rights Reserved.                                                      *
 *===========================================================================*/

#ifndef VrpModel_h_
#define VrpModel_h_

//#############################################################################

#include <vector>

#include "BlisModel.h"
#include "VrpVariable.h"
#include "VrpCommonTypes.h"
#include "VrpConstants.h"
#include "VrpParams.h"
#include "VrpCutGenerator.h"

//#############################################################################

/** Model class for VRP. */
class VrpModel : public BlisModel 
{    

   friend class VrpCutGenerator;
   
 private:

   char name_[100];
   int vertnum_;
   int edgenum_;
   int numroutes_;
   int depot_;
   int capacity_;
   int wtype_;
   int *demand_;    /*vertnum_*/
   int *posx_;      /*vertnum_*/
   int *posy_;      /*vertnum_*/
   double *coordx_; /*vertnum_*/
   double *coordy_; /*vertnum_*/
   double *coordz_; /*vertnum_*/
   double etol_;

   VrpParams *VrpPar_;
   VrpNetwork *n_;  /* Allocate when readInstance */
   
   // edges_ hold the same elements as variables_ does, do not free memory.
   // For parallel, reinsert elements in variables_ to edges_
   std::vector<VrpVariable *> edges_;

   // Do we need this? Solution?
   std::vector<best_tours> curTour_;

protected:

   /** 1) Set colMatrix_, varLB_, varUB_, conLB_, conUB, numCols_, numRows_
    *  2) Set objCoef_ and objSense_
    *  3) Set colType_ ('C', 'I', or 'B')
    */
   void setModelData();
   
public:

    /** Default construtor. */
   VrpModel() : vertnum_(0), edgenum_(0), numroutes_(0), depot_(0),
      capacity_(0), wtype_(0), etol_(1e-5){
      demand_ = 0;
      posx_ = 0;
      posy_ = 0;
      coordx_ = 0;
      coordy_ = 0;
      coordz_ = 0;
      n_ = 0;
      VrpPar_ = new VrpParams;

      AlpsPar()->setEntry(AlpsParams::searchStrategy, ALPS_SEARCH_BEST);

      BlisPar()->setEntry(BlisParams::cutClique,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutFlowCover,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutGomory,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutKnapsack,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutMir,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutOddHole,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutProbing,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::cutTwoMir,BLIS_NONE);
      BlisPar()->setEntry(BlisParams::heurRound,BLIS_NONE);
{'fraction_non_alphanumeric': 0.19845594913714804, 'fraction_numerical': 0.007568876778686043, 'mean_word_length': 2.181030332209918, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5803263', 'n_tokens_mistral': 1959, 'n_tokens_neox': 1864, 'n_words': 431}