Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
build
buildd
coinor-cbc-2.5.0
debian
tmp
usr
include
coin
CbcEventHandler.hpp
Go to the documentation of this file.
1
6
#ifndef CbcEventHandler_H
7
#define CbcEventHandler_H
8
45
#include <map>
46
47
/* May well already be declared, but can't hurt. */
48
49
class
CbcModel
;
50
51
/*
52
cvs/svn: $Id: CbcEventHandler.hpp 1432 2010-02-07 19:33:53Z bjarni $
53
*/
54
77
class
CbcEventHandler
{
78
79
public
:
80
83
enum
CbcEvent
{
84
node
= 200,
86
treeStatus
,
88
solution
,
90
heuristicSolution
,
92
beforeSolution1
,
94
beforeSolution2
,
96
endSearch
97
} ;
98
104
enum
CbcAction
{
105
noAction
= -1,
107
stop
= 0,
111
restart
,
113
restartRoot
,
115
addCuts
,
117
killSolution
118
119
} ;
120
123
typedef
std::map<CbcEvent, CbcAction>
eaMapPair
;
124
125
128
135
virtual
CbcAction
event
(
CbcEvent
whichEvent) ;
136
138
139
142
145
CbcEventHandler
(
CbcModel
*model = 0) ;
146
149
CbcEventHandler
(
const
CbcEventHandler
&orig) ;
150
153
CbcEventHandler
&
operator=
(
const
CbcEventHandler
&rhs) ;
154
157
virtual
CbcEventHandler
*
clone
()
const
;
158
161
virtual
~CbcEventHandler
() ;
162
164
167
170
inline
void
setModel
(
CbcModel
*model) {
171
model_
= model ;
172
}
173
176
inline
const
CbcModel
*
getModel
()
const
{
177
return
model_
;
178
}
179
182
inline
void
setDfltAction
(
CbcAction
action) {
183
dfltAction_
= action ;
184
}
185
188
inline
void
setAction
(
CbcEvent
event
,
CbcAction
action) {
189
if
(
eaMap_
== 0) {
190
eaMap_
=
new
eaMapPair
;
191
}
192
(*eaMap_)[
event
] = action ;
193
}
194
196
197
198
protected
:
199
205
208
CbcModel
*
model_
;
209
212
CbcAction
dfltAction_
;
213
216
eaMapPair
*
eaMap_
;
217
219
} ;
220
221
#endif
222
Generated on Fri Jun 29 2012 06:31:52 by
1.8.1.1