AlpsSolution.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of the Abstract Library for Parallel Search (ALPS). *
3  * *
4  * ALPS is distributed under the Eclipse Public License as part of the *
5  * COIN-OR repository (http://www.coin-or.org). *
6  * *
7  * Authors: *
8  * *
9  * Yan Xu, Lehigh University *
10  * Ted Ralphs, Lehigh University *
11  * *
12  * Conceptual Design: *
13  * *
14  * Yan Xu, Lehigh University *
15  * Ted Ralphs, Lehigh University *
16  * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17  * Matthew Saltzman, Clemson University *
18  * *
19  * *
20  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21  *===========================================================================*/
22 
23 #ifndef AlpsSolution_h_
24 #define AlpsSolution_h_
25 
26 #include <iosfwd>
27 #include <map>
28 #include <vector>
29 
30 #include "AlpsKnowledge.h"
31 #include "AlpsTreeNode.h" // to get AlpsNodeIndex_t
32 
33 //#############################################################################
34 
35 class AlpsSolution : public AlpsKnowledge {
36 
37  private:
39  AlpsSolution(const AlpsSolution&);
41 
43  int index_;
44 
46  int depth_;
47 
48  public:
49 
52  index_(-1),
53  depth_(-1)
54  {
56  }
57 
59  AlpsSolution(const AlpsNodeIndex_t i, const int d) :
60  index_(i),
61  depth_(d)
62  {
64  }
65 
67  virtual ~AlpsSolution() {}
68 
71 
73  void setIndex(const AlpsNodeIndex_t i) { index_ = i; }
74 
76  int getDepth() { return depth_; }
77 
79  void setDepth(const int d) { depth_ = d; }
80 
82  virtual void print(std::ostream& os) const{
83  os << "WARNING: No solution print function is defined." << std::endl;
84  }
85 };
86 
87 #endif
virtual void print(std::ostream &os) const
Print out the solution.
Definition: AlpsSolution.h:82
AlpsSolution & operator=(const AlpsSolution &)
int depth_
The depth of the node where the solution was found.
Definition: AlpsSolution.h:46
virtual ~AlpsSolution()
Destructor.
Definition: AlpsSolution.h:67
void setIndex(const AlpsNodeIndex_t i)
Set index where solution was found.
Definition: AlpsSolution.h:73
AlpsNodeIndex_t getIndex()
Get index where solution was found.
Definition: AlpsSolution.h:70
AlpsSolution(const AlpsNodeIndex_t i, const int d)
Constructor to set index and depth.
Definition: AlpsSolution.h:59
int getDepth()
Get depth where solution was found.
Definition: AlpsSolution.h:76
int AlpsNodeIndex_t
Definition: AlpsTreeNode.h:37
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
Definition: AlpsKnowledge.h:51
int index_
The index of the node where the solution was found.
Definition: AlpsSolution.h:43
void setDepth(const int d)
Set depth where solution was found.
Definition: AlpsSolution.h:79
AlpsSolution()
Default constructor.
Definition: AlpsSolution.h:51
void setType(KnowledgeType t)
Definition: AlpsKnowledge.h:72