Version: 8.3.0
YACS::ENGINE::OptimizerAlgASync Class Referenceabstract

Base class to implement in external dynamic lib in case of optimizer non event oriented. More...

#include <OptimizerAlg.hxx>

Inheritance diagram for YACS::ENGINE::OptimizerAlgASync:
Collaboration diagram for YACS::ENGINE::OptimizerAlgASync:

Public Member Functions

virtual ~OptimizerAlgASync ()
 
virtual void finishProxy ()
 
- Public Member Functions inherited from YACS::ENGINE::OptimizerAlgBase
virtual TypeCodegetTCForInProxy () const
 
virtual TypeCodegetTCForOutProxy () const
 
virtual TypeCodegetTCForAlgoInitProxy () const
 
virtual TypeCodegetTCForAlgoResultProxy () const
 
virtual void initializeProxy (const Any *input) throw (Exception)
 
virtual void startProxy ()
 
virtual void takeDecisionProxy ()
 
virtual AnygetAlgoResultProxy ()
 
virtual void setPool (Pool *pool)
 
virtual void setProc (Proc *proc)
 
virtual ProcgetProc ()
 
virtual bool hasError () const
 
virtual const std::string & getError () const
 
virtual void setError (const std::string &message)
 
void setNbOfBranches (int nbOfBranches)
 
int getNbOfBranches () const
 
- Public Member Functions inherited from YACS::ENGINE::RefCounter
unsigned int getRefCnt () const
 
void incrRef () const
 
bool decrRef ()
 

Protected Member Functions

 OptimizerAlgASync (Pool *pool)
 
virtual void start ()
 Called when optimization has succeed. More...
 
virtual void takeDecision ()
 Update _pool attribute before performing anything. More...
 
virtual void run ()
 
virtual void startToTakeDecision ()=0
 
- Protected Member Functions inherited from YACS::ENGINE::OptimizerAlgBase
 OptimizerAlgBase (Pool *pool)
 
virtual ~OptimizerAlgBase ()
 
virtual TypeCodegetTCForIn () const =0
 returns typecode of type expected as Input. OwnerShip of returned pointer is held by this. More...
 
virtual TypeCodegetTCForOut () const =0
 returns typecode of type expected as Output. OwnerShip of returned pointer is held by this. More...
 
virtual TypeCodegetTCForAlgoInit () const
 returns typecode of type expected for algo initialization. OwnerShip of returned pointer is held by this. More...
 
virtual TypeCodegetTCForAlgoResult () const
 returns typecode of type expected as algo result. OwnerShip of returned pointer is held by this. More...
 
virtual void initialize (const Any *input) throw (Exception)
 
virtual void finish ()
 
virtual AnygetAlgoResult ()
 Called when optimization has succeed. More...
 
- Protected Member Functions inherited from YACS::ENGINE::RefCounter
 RefCounter ()
 
 RefCounter (const RefCounter &other)
 
virtual ~RefCounter ()
 

Additional Inherited Members

- Static Public Attributes inherited from YACS::ENGINE::RefCounter
static unsigned int _totalCnt =0
 
- Protected Attributes inherited from YACS::ENGINE::OptimizerAlgBase
Pool_pool
 
Proc_proc
 
std::string _errorMessage
 
int _nbOfBranches
 

Detailed Description

Base class to implement in external dynamic lib in case of optimizer non event oriented.

Definition at line 99 of file OptimizerAlg.hxx.

Constructor & Destructor Documentation

OptimizerAlgASync::OptimizerAlgASync ( Pool pool)
protected

Definition at line 143 of file OptimizerAlg.cxx.

143  :OptimizerAlgBase(pool)
144 {
145 }
OptimizerAlgASync::~OptimizerAlgASync ( )
virtual

Definition at line 147 of file OptimizerAlg.cxx.

148 {
149 }

Member Function Documentation

void OptimizerAlgASync::finishProxy ( )
virtual

Reimplemented from YACS::ENGINE::OptimizerAlgBase.

Definition at line 151 of file OptimizerAlg.cxx.

References YACS::ENGINE::OptimizerAlgBase::finishProxy().

152 {
153  terminateSlaveThread();
155 }
void OptimizerAlgASync::run ( )
protectedvirtual

_pool->getCurrentId gives the id at the origin of this call. Perform the job of analysing to know what new jobs to do (_pool->pushInSample) or in case of convergence _pool->destroyAll

Definition at line 167 of file OptimizerAlg.cxx.

References YACS::ENGINE::OptimizerAlgBase::_pool, YACS::ENGINE::Pool::destroyAll(), and startToTakeDecision().

168 {
170  _pool->destroyAll();
171 }
void OptimizerAlgASync::start ( )
protectedvirtual

Called when optimization has succeed.

Implements YACS::ENGINE::OptimizerAlgBase.

Definition at line 162 of file OptimizerAlg.cxx.

163 {
164  AlternateThread::start();
165 }
virtual void YACS::ENGINE::OptimizerAlgASync::startToTakeDecision ( )
protectedpure virtual

_pool->getCurrentId gives the id at the origin of this call. Perform the job between 2 'condition->wait()' of analysing to know what new jobs to do (_pool->pushInSample) or in case of convergence _pool->destroyAll WARNING ! 'condition->wait()' must be called before any analyse of Pool.

Referenced by run().

void OptimizerAlgASync::takeDecision ( )
protectedvirtual

Update _pool attribute before performing anything.

Implements YACS::ENGINE::OptimizerAlgBase.

Definition at line 157 of file OptimizerAlg.cxx.

158 {
159  signalSlaveAndWait();
160 }

The documentation for this class was generated from the following files: