1 // Copyright (C) 2006-2016 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, or (at your option) any later version.
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 "saclass.hxx"
24 #include "topologie.hxx"
30 SalomeTest::SalomeTest(Superviseur &t)
33 rnd1 = (SpherePositif *) NULL;
34 st1 = (Traditionnel *) NULL;
35 rnd2 = (Sphere *) NULL;
38 dst = (SalomeEventLoop *) NULL;
39 dec = (LinearDecoder *) NULL;
40 mtr = (Maestro *) NULL;
42 swrm = (MonoSwarm *) NULL;
46 SalomeTest::~SalomeTest(void)
60 void SalomeTest::readFromFile(std::string rien)
62 std::vector<std::pair<double, double> > dom(NBGENE);
65 // domaine de recherche
66 for (i=0; i<NBGENE; i++) {
67 dom[i].first = BORNEMIN;
68 dom[i].second = BORNEMAX;
72 // operateur stochastique
73 rnd1 = new SpherePositif(NBGENE);
74 st1 = new Traditionnel(NBGENE, *rnd1);
75 rnd2 = new Sphere(NBGENE);
76 st2 = new Pivot(NBGENE, *rnd2);
78 dst = new SalomeEventLoop(*super);
79 dec = new LinearDecoder(dom);
80 mtr = new Maestro((Decoder &) *dec, (Critere *) NULL, (Distrib &) *dst);
82 swrm = new MonoSwarm(PLAN, NBGENE, (Topologie &) top, (Movement &) *st1, (Movement &) *st1, *mtr);
84 swrm->setStop(NBEVAL);
87 void SalomeTest::start(void)
92 void SalomeTest::next(void)
98 void SalomeTest::finish(void)
103 res = swrm->solution();