Version: 8.3.0
OptimizerAlg.cxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2016 CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #include "OptimizerAlg.hxx"
21 #include "Runtime.hxx"
22 
23 using namespace YACS::BASES;
24 using namespace YACS::ENGINE;
25 
26 OptimizerAlgBase::OptimizerAlgBase(Pool *pool):_pool(pool), _proc(NULL)
27 {
28 }
29 
31 {
32 }
33 
35 {
36 }
37 
39 {
40 }
41 
43 {
44  return Runtime::_tc_string;
45 }
46 
48 {
49  return Runtime::_tc_string;
50 }
51 
53 {
54  return NULL;
55 }
56 
58 {
59  return getTCForIn();
60 }
61 
63 {
64  return getTCForOut();
65 }
66 
68 {
69  return getTCForAlgoInit();
70 }
71 
73 {
74  return getTCForAlgoResult();
75 }
76 
78 {
79  initialize(input);
80 }
81 
83 {
84  start();
85 }
86 
88 {
89  takeDecision();
90 }
91 
93 {
94  finish();
95  _errorMessage = "";
96 }
97 
99 {
100  return getAlgoResult();
101 }
102 
104 {
105  _pool=pool;
106 }
107 
109 {
110  _proc = proc;
111 }
112 
114 {
115  return _proc;
116 }
117 
119 {
120  return (_errorMessage.length() > 0);
121 }
122 
123 const std::string & OptimizerAlgBase::getError() const
124 {
125  return _errorMessage;
126 }
127 
128 void OptimizerAlgBase::setError(const std::string & message)
129 {
130  _errorMessage = (message.length() > 0) ? message : "Unknown error";
131 }
132 
133 void OptimizerAlgBase::setNbOfBranches(int nbOfBranches)
134 {
135  _nbOfBranches=nbOfBranches;
136 }
137 
139 {
140  return _nbOfBranches;
141 }
142 
144 {
145 }
146 
148 {
149 }
150 
152 {
153  terminateSlaveThread();
155 }
156 
158 {
159  signalSlaveAndWait();
160 }
161 
163 {
164  AlternateThread::start();
165 }
166 
168 {
170  _pool->destroyAll();
171 }