- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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&);
40 AlpsSolution& operator=(const AlpsSolution&);
41
43 int index_;
44
46 int depth_;
47
48 public:
49
51 AlpsSolution() :
52 index_(-1),
53 depth_(-1)
54 {
55 setType(AlpsKnowledgeTypeSolution);
56 }
57
59 AlpsSolution(const AlpsNodeIndex_t i, const int d) :
60 index_(i),
61 depth_(d)
62 {
63 setType(AlpsKnowledgeTypeSolution);
64 }
65
67 virtual ~AlpsSolution() {}
68
70 AlpsNodeIndex_t getIndex() { return index_; }
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
AlpsSolution::print
virtual void print(std::ostream &os) const
Print out the solution.
Definition: AlpsSolution.h:82
AlpsSolution::operator=
AlpsSolution & operator=(const AlpsSolution &)
AlpsSolution::depth_
int depth_
The depth of the node where the solution was found.
Definition: AlpsSolution.h:46
AlpsSolution::~AlpsSolution
virtual ~AlpsSolution()
Destructor.
Definition: AlpsSolution.h:67
AlpsSolution::setIndex
void setIndex(const AlpsNodeIndex_t i)
Set index where solution was found.
Definition: AlpsSolution.h:73
AlpsSolution::getIndex
AlpsNodeIndex_t getIndex()
Get index where solution was found.
Definition: AlpsSolution.h:70
AlpsSolution::AlpsSolution
AlpsSolution(const AlpsNodeIndex_t i, const int d)
Constructor to set index and depth.
Definition: AlpsSolution.h:59
AlpsKnowledge.h
AlpsSolution::getDepth
int getDepth()
Get depth where solution was found.
Definition: AlpsSolution.h:76
AlpsNodeIndex_t
int AlpsNodeIndex_t
Definition: AlpsTreeNode.h:37
AlpsKnowledge
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
Definition: AlpsKnowledge.h:51
AlpsSolution::index_
int index_
The index of the node where the solution was found.
Definition: AlpsSolution.h:43
AlpsSolution::setDepth
void setDepth(const int d)
Set depth where solution was found.
Definition: AlpsSolution.h:79
AlpsTreeNode.h
AlpsSolution::AlpsSolution
AlpsSolution()
Default constructor.
Definition: AlpsSolution.h:51
AlpsSolution
Definition: AlpsSolution.h:35
AlpsKnowledgeTypeSolution
Definition: Alps.h:92
AlpsKnowledge::setType
void setType(KnowledgeType t)
Definition: AlpsKnowledge.h:72