Version: 9.16.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 TypeCode * getTCForInProxy () const
 
virtual TypeCode * getTCForOutProxy () const
 
virtual TypeCode * getTCForAlgoInitProxy () const
 
virtual TypeCode * getTCForAlgoResultProxy () const
 
virtual void initializeProxy (const Any *input)
 
virtual void startProxy ()
 
virtual void takeDecisionProxy ()
 
virtual void finishProxy ()
 
virtual Any * getAlgoResultProxy ()
 
virtual void setPool (Pool *pool)
 
virtual void setProc (Proc *proc)
 
virtual Proc * getProc ()
 
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 () const
 

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 TypeCode * getTCForIn () const =0
 returns typecode of type expected as Input. OwnerShip of returned pointer is held by this. More...
 
virtual TypeCode * getTCForOut () const =0
 returns typecode of type expected as Output. OwnerShip of returned pointer is held by this. More...
 
virtual TypeCode * getTCForAlgoInit () const
 returns typecode of type expected for algo initialization. OwnerShip of returned pointer is held by this. More...
 
virtual TypeCode * getTCForAlgoResult () const
 returns typecode of type expected as algo result. OwnerShip of returned pointer is held by this. More...
 
virtual void initialize (const Any *input)
 
virtual void start ()=0
 
virtual void takeDecision ()=0
 Update _pool attribute before performing anything. More...
 
virtual void finish ()
 
virtual Any * getAlgoResult ()
 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
 
- Protected Attributes inherited from YACS::ENGINE::RefCounter
unsigned int _cnt
 

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::OptimizerAlgASync ( Pool *  pool)
protected

Definition at line 143 of file OptimizerAlg.cxx.

143 :OptimizerAlgBase(pool)
144{
145}

◆ ~OptimizerAlgASync()

OptimizerAlgASync::~OptimizerAlgASync ( )
virtual

Definition at line 147 of file OptimizerAlg.cxx.

148{
149}

Member Function Documentation

◆ finishProxy()

void OptimizerAlgASync::finishProxy ( )
virtual

Reimplemented from YACS::ENGINE::OptimizerAlgBase.

Definition at line 151 of file OptimizerAlg.cxx.

152{
153 terminateSlaveThread();
155}

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

◆ run()

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().

◆ start()

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}

◆ startToTakeDecision()

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().

◆ takeDecision()

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: