Version: 8.3.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
YACS
Introduction
Features
Packages
Building
TODOs
Base classes
Engine
SALOME Runtime
XML file loader
GUI design
Python wrapping
PMMLlib C++ examples
Configuring and Installing PMML from sources
PMMLlib
PMMLlib Python examples
Modules
Namespaces
Classes
Files
File List
idl
src
bases
engine
Plugin
aleas.cxx
aleas.hxx
critere.hxx
decode.cxx
decode.hxx
distrib.hxx
fonction.hxx
local.cxx
local.hxx
maestro.cxx
maestro.hxx
mt19937ar.cxx
PluginSimplex.cxx
PluginSimplex.hxx
point.cxx
point.hxx
saclass.cxx
saclass.hxx
saconst.h
saemul.cxx
saemul.hxx
salomesup.hxx
salomevent.cxx
salomevent.hxx
sasimpl.cxx
sasimpl.hxx
satest.cxx
simplex.cxx
simplex.hxx
solution.cxx
solution.hxx
AbstractPoint.cxx
AbstractPoint.hxx
Any.cxx
Any.hxx
AnyInputPort.cxx
AnyInputPort.hxx
AnyOutputPort.cxx
AnyOutputPort.hxx
BagPoint.cxx
BagPoint.hxx
Bloc.cxx
Bloc.hxx
BlocPoint.cxx
BlocPoint.hxx
Catalog.cxx
Catalog.hxx
ComponentDefinition.cxx
ComponentDefinition.hxx
ComponentInstance.cxx
ComponentInstance.hxx
ComposedNode.cxx
ComposedNode.hxx
ConditionInputPort.cxx
ConditionInputPort.hxx
Container.cxx
Container.hxx
ConversionException.cxx
ConversionException.hxx
DataFlowPort.cxx
DataFlowPort.hxx
DataNode.cxx
DataNode.hxx
DataPort.cxx
DataPort.hxx
DataStreamPort.cxx
DataStreamPort.hxx
DeploymentTree.cxx
DeploymentTree.hxx
Dispatcher.cxx
Dispatcher.hxx
DynParaLoop.cxx
DynParaLoop.hxx
ElementaryNode.cxx
ElementaryNode.hxx
ElementaryPoint.cxx
ElementaryPoint.hxx
Executor.cxx
Executor.hxx
ForEachLoop.cxx
ForEachLoop.hxx
ForkBlocPoint.cxx
ForkBlocPoint.hxx
ForLoop.cxx
ForLoop.hxx
HomogeneousPoolContainer.cxx
HomogeneousPoolContainer.hxx
InGate.cxx
InGate.hxx
InlineNode.cxx
InlineNode.hxx
InPort.cxx
InPort.hxx
InPropertyPort.cxx
InPropertyPort.hxx
InputDataStreamPort.cxx
InputDataStreamPort.hxx
InputPort.cxx
InputPort.hxx
InvalidExtractionException.cxx
InvalidExtractionException.hxx
LinkedBlocPoint.cxx
LinkedBlocPoint.hxx
LinkInfo.cxx
LinkInfo.hxx
Logger.cxx
Logger.hxx
LogRecord.cxx
LogRecord.hxx
Loop.cxx
Loop.hxx
Node.cxx
Node.hxx
OptimizerAlg.cxx
OptimizerAlg.hxx
OptimizerLoop.cxx
OptimizerLoop.hxx
OutGate.cxx
OutGate.hxx
OutPort.cxx
OutPort.hxx
OutputDataStreamPort.cxx
OutputDataStreamPort.hxx
OutputPort.cxx
OutputPort.hxx
Pool.cxx
Pool.hxx
Port.cxx
Port.hxx
Proc.cxx
Proc.hxx
PropertyInterface.cxx
PropertyInterface.hxx
RefCounter.cxx
RefCounter.hxx
Runtime.cxx
Runtime.hxx
Scheduler.cxx
Scheduler.hxx
ServerNode.cxx
ServerNode.hxx
ServiceInlineNode.cxx
ServiceInlineNode.hxx
ServiceNode.cxx
ServiceNode.hxx
SetOfPoints.cxx
SetOfPoints.hxx
SharedPtr.hxx
StaticDefinedComposedNode.cxx
StaticDefinedComposedNode.hxx
Switch.cxx
Switch.hxx
Task.cxx
Task.hxx
TypeCode.cxx
TypeCode.hxx
Visitor.cxx
Visitor.hxx
VisitorSaveSchema.cxx
VisitorSaveSchema.hxx
VisitorSaveState.cxx
VisitorSaveState.hxx
WhileLoop.cxx
WhileLoop.hxx
YACSlibEngineExport.hxx
genericgui
hmi
pmml
pyqt
runtime
salomegui
salomewrap
yacsloader
yacsorb
File Members
PluginSimplex.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 "
PluginSimplex.hxx
"
21
#include "
TypeCode.hxx
"
22
#include "
Pool.hxx
"
23
24
#include "
saconst.h
"
25
26
#include "
solution.hxx
"
27
28
#include <cmath>
29
30
using namespace
YACS::ENGINE;
31
32
PluginSimplex::PluginSimplex
(
Pool
*pool):
OptimizerAlgSync
(pool),_tc(0)
33
{
34
// type
35
TypeCode
*tctmp=
new
TypeCode
(
Double
);
36
_tc
=
new
TypeCodeSeq
(
""
,
""
, tctmp);
37
tctmp->
decrRef
();
38
// distribution
39
dst
= (
SalomeEventLoop
*) NULL;
40
dec
= (
LinearDecoder
*) NULL;
41
mtr
= (
Maestro
*) NULL;
42
// swarm
43
solv
= (
Simplex
*) NULL;
44
45
}
46
47
PluginSimplex::~PluginSimplex
()
48
{
49
_tc
->
decrRef
();
50
// distribution
51
delete
dst
;
52
delete
dec
;
53
delete
mtr
;
54
// swarm
55
delete
solv
;
56
}
57
58
TypeCode
*
PluginSimplex::getTCForIn
()
const
59
{
60
return
_tc
;
61
}
62
63
TypeCode
*
PluginSimplex::getTCForOut
()
const
64
{
65
return
_tc
;
66
}
67
68
void
PluginSimplex::parseFileToInit
(
const
std::string& fileName)
69
{
70
std::vector<std::pair<double, double> > dom(
NBGENE
);
71
long
i
;
72
73
// domaine de recherche
74
for
(i=0; i<
NBGENE
; i++) {
75
dom[
i
].first =
BORNEMIN
;
76
dom[
i
].second =
BORNEMAX
;
77
}
78
// distribution
79
dst
=
new
SalomeEventLoop
(
_pool
);
80
dec
=
new
LinearDecoder
(dom);
81
mtr
=
new
Maestro
((
Decoder
&) *
dec
, (
Critere
*) NULL, (
Distrib
&) *
dst
);
82
// swarm
83
solv
=
new
Simplex
(
NBNODE
, NBGENE, *
mtr
);
84
85
solv
->
setStop
(
NBEVAL
);
86
}
87
88
void
PluginSimplex::start
()
89
{
90
solv
->
start
();
91
}
92
93
void
PluginSimplex::takeDecision
()
94
{
95
int
rien;
96
rien =
solv
->
next
();
97
}
98
99
void
PluginSimplex::initialize
(
const
Any
*input)
throw
(
YACS::Exception
)
100
{
101
}
102
103
void
PluginSimplex::finish
()
104
{
105
Solution
*res;
106
107
solv
->
finish
();
108
res =
solv
->
solution
();
109
dec
->
echo
(*res);
110
}
111
112
OptimizerAlgBase
*
PluginSimplexFactory
(
Pool
*pool)
113
{
114
return
new
PluginSimplex
(pool);
115
}
116
src
engine
Plugin
PluginSimplex.cxx
Copyright © 2006-2017 CEA/DEN, EDF R&D