Alps 1.5.11
Loading...
Searching...
No Matches
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-2023, 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:
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
int AlpsNodeIndex_t
@ 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...
void setType(KnowledgeType t)
int depth_
The depth of the node where the solution was found.
void setIndex(const AlpsNodeIndex_t i)
Set index where solution was found.
virtual void print(std::ostream &os) const
Print out the solution.
int index_
The index of the node where the solution was found.
virtual ~AlpsSolution()
Destructor.
AlpsSolution(const AlpsSolution &)
Diable copy constructor and assignment.
AlpsSolution & operator=(const AlpsSolution &)
AlpsSolution(const AlpsNodeIndex_t i, const int d)
Constructor to set index and depth.
void setDepth(const int d)
Set depth where solution was found.
int getDepth()
Get depth where solution was found.
AlpsSolution()
Default constructor.
AlpsNodeIndex_t getIndex()
Get index where solution was found.