1 // Copyright (C) 2006-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "PluginOptEvTest1.hxx"
21 #include "TypeCode.hxx"
26 using namespace YACS::ENGINE;
28 PluginOptEvTest1::PluginOptEvTest1(Pool *pool):OptimizerAlgSync(pool),_tcIn(0),_tcOut(0),_idTest(0)
30 _tcIn=new TypeCode(Double);
31 _tcOut=new TypeCode(Int);
34 PluginOptEvTest1::~PluginOptEvTest1()
40 TypeCode *PluginOptEvTest1::getTCForIn() const
45 TypeCode *PluginOptEvTest1::getTCForOut() const
50 void PluginOptEvTest1::parseFileToInit(const std::string& fileName)
54 void PluginOptEvTest1::start()
57 Any *val=AtomAny::New(1.2);
58 _pool->pushInSample(4,val);
59 val=AtomAny::New(3.4);
60 _pool->pushInSample(9,val);
63 void PluginOptEvTest1::takeDecision()
67 Any *val=AtomAny::New(5.6);
68 _pool->pushInSample(16,val);
69 val=AtomAny::New(7.8);
70 _pool->pushInSample(25,val);
71 val=AtomAny::New(9. );
72 _pool->pushInSample(36,val);
73 val=AtomAny::New(12.3);
74 _pool->pushInSample(49,val);
78 Any *val=AtomAny::New(45.6);
79 _pool->pushInSample(64,val);
80 val=AtomAny::New(78.9);
81 _pool->pushInSample(81,val);
85 Any *tmp= _pool->getCurrentInSample();
86 if(fabs(tmp->getDoubleValue()-45.6)<1.e-12)
92 void PluginOptEvTest1::initialize(const Any *input) throw(YACS::Exception)
96 void PluginOptEvTest1::finish()
100 OptimizerAlgBase *PluginOptEvTest1Factory(Pool *pool)
102 return new PluginOptEvTest1(pool);