1 #include "PluginSimplex.hxx"
2 #include "TypeCode.hxx"
7 #include "solution.hxx"
11 using namespace YACS::ENGINE;
13 PluginSimplex::PluginSimplex(Pool *pool):OptimizerAlgSync(pool),_tc(0)
16 TypeCode *tctmp=new TypeCode(Double);
17 _tc=new TypeCodeSeq("", "", tctmp);
20 dst = (SalomeEventLoop *) NULL;
21 dec = (LinearDecoder *) NULL;
22 mtr = (Maestro *) NULL;
24 solv = (Simplex *) NULL;
28 PluginSimplex::~PluginSimplex()
39 TypeCode *PluginSimplex::getTCForIn() const
44 TypeCode *PluginSimplex::getTCForOut() const
49 void PluginSimplex::parseFileToInit(const std::string& fileName)
51 std::vector<std::pair<double, double> > dom(NBGENE);
54 // domaine de recherche
55 for (i=0; i<NBGENE; i++) {
56 dom[i].first = BORNEMIN;
57 dom[i].second = BORNEMAX;
60 dst = new SalomeEventLoop(_pool);
61 dec = new LinearDecoder(dom);
62 mtr = new Maestro((Decoder &) *dec, (Critere *) NULL, (Distrib &) *dst);
64 solv = new Simplex(NBNODE, NBGENE, *mtr);
66 solv->setStop(NBEVAL);
69 void PluginSimplex::start()
74 void PluginSimplex::takeDecision()
80 void PluginSimplex::initialize(const Any *input) throw (Exception)
84 void PluginSimplex::finish()
89 res = solv->solution();
93 OptimizerAlgBase *PluginSimplexFactory(Pool *pool)
95 return new PluginSimplex(pool);