2 // -*- coding: latin_1 -*-
5 // creation : 2007-03-23.02.08.59
8 // Copyright © 2007 Commissariat à l'Energie Atomique
9 // par Gilles ARNAUD (DM2S/SFME/LETR)
10 // C.E. Saclay; Bat 454; 91191 GIF/YVETTE CEDEX; France
11 // Tel: 01 69 08 38 86; Fax : 33 1 69 08 85 68
12 // Gilles.Arnaud@cea.fr
15 // class emulateur superviseur salome
17 //___________________________________________________________________
25 Emulator::Emulator(void)
27 solver = new SalomeTest((Superviseur &) *this);
30 Emulator::~Emulator(void)
36 void Emulator::destroyAll(void)
38 std::pair<long,std::vector<double> *> pa;
47 void Emulator::push(long id, std::vector<double> &cal)
49 std::pair<long, std::vector<double> *> *tmp;
51 tmp = new std::pair<long, std::vector<double> *>(id, &cal);
56 long Emulator::getCurrentId(void)
58 std::vector<double> *cal;
59 std::pair<long,std::vector<double> *> pa;
61 pa = q.front(); q.pop();
68 std::vector<double> *Emulator::getCurrentOut(void)
73 std::vector<double> *Emulator::eval(std::vector<double> &x)
75 std::vector<double> *res;
76 res = new std::vector<double>(1);
84 (*res)[0] = fabs(x1) + fabs(x2+50);
86 (*res)[0] = fabs(x2-50);
88 (*res)[0] += 1 + fabs(x1+50);
90 (*res)[0] += 2 + fabs(x1-50);
97 x1 = x[0] ; x2 = x1*x1 - x[1]; x1 -= 1;
98 (*res)[0] = x1*x1 + 100*x2*x2 ;
105 for (i=0; i<NBGENE; i++) {
108 x2 *= cos(y/sqrt(i+1));
110 (*res)[0] = x1 / 4000 - x2 + 1;
115 void Emulator::run(void)
117 solver->readFromFile("caca");