Alps 1.5.7
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-2019, 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
35class AlpsSolution : public AlpsKnowledge {
36
37 private:
40 AlpsSolution& operator=(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
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
int AlpsNodeIndex_t
Definition: AlpsTreeNode.h:37
@ AlpsKnowledgeTypeSolution
Definition: Alps.h:92
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
Definition: AlpsKnowledge.h:51
void setType(KnowledgeType t)
Definition: AlpsKnowledge.h:72
void setIndex(const AlpsNodeIndex_t i)
Set index where solution was found.
Definition: AlpsSolution.h:73
virtual void print(std::ostream &os) const
Print out the solution.
Definition: AlpsSolution.h:82
virtual ~AlpsSolution()
Destructor.
Definition: AlpsSolution.h:67
AlpsSolution(const AlpsNodeIndex_t i, const int d)
Constructor to set index and depth.
Definition: AlpsSolution.h:59
void setDepth(const int d)
Set depth where solution was found.
Definition: AlpsSolution.h:79
int getDepth()
Get depth where solution was found.
Definition: AlpsSolution.h:76
AlpsSolution()
Default constructor.
Definition: AlpsSolution.h:51
AlpsNodeIndex_t getIndex()
Get index where solution was found.
Definition: AlpsSolution.h:70