1 // Copyright (C) 2006-2008 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
19 #include "saclass.hxx"
23 #include "topologie.hxx"
29 SalomeTest::SalomeTest(Superviseur &t)
32 rnd1 = (SpherePositif *) NULL;
33 st1 = (Traditionnel *) NULL;
34 rnd2 = (Sphere *) NULL;
37 dst = (SalomeEventLoop *) NULL;
38 dec = (LinearDecoder *) NULL;
39 mtr = (Maestro *) NULL;
41 swrm = (MonoSwarm *) NULL;
45 SalomeTest::~SalomeTest(void)
59 void SalomeTest::readFromFile(std::string rien)
61 std::vector<std::pair<double, double> > dom(NBGENE);
64 // domaine de recherche
65 for (i=0; i<NBGENE; i++) {
66 dom[i].first = BORNEMIN;
67 dom[i].second = BORNEMAX;
71 // operateur stochastique
72 rnd1 = new SpherePositif(NBGENE);
73 st1 = new Traditionnel(NBGENE, *rnd1);
74 rnd2 = new Sphere(NBGENE);
75 st2 = new Pivot(NBGENE, *rnd2);
77 dst = new SalomeEventLoop(*super);
78 dec = new LinearDecoder(dom);
79 mtr = new Maestro((Decoder &) *dec, (Critere *) NULL, (Distrib &) *dst);
81 swrm = new MonoSwarm(PLAN, NBGENE, (Topologie &) top, (Movement &) *st1, (Movement &) *st1, *mtr);
83 swrm->setStop(NBEVAL);
86 void SalomeTest::start(void)
91 void SalomeTest::next(void)
97 void SalomeTest::finish(void)
102 res = swrm->solution();