#include <D:/Temp/vs/gal/source/Algorithm.h>
Inherits Algorithm::GaAlgorithm.
Inherited by Algorithm::GaMultithreadingAlgorithm.
Public Member Functions | |
GaBaseAlgorithm () | |
This constructor sets initial state of algorithm's execution. | |
virtual GAL_API void GACALL | StartSolving (bool continueSolving) |
Detailed description is given in specification of GaAlgorithm::StartSolving method. Diagram shows when this method can be called. | |
virtual GAL_API void GACALL | StopSolving () |
Detailed description is given in specification of GaAlgorithm::StopSolving method. Diagram shows when this method can be called. | |
virtual GAL_API void GACALL | PauseSolving () |
Detailed description is given in specification of GaAlgorithm::PauseSolving method. Diagram shows when this method can be called. | |
virtual void GACALL | BeginParameterChange () |
Detailed description is given in specification of GaAlgorithm::BeginParameterChange method. | |
virtual void GACALL | EndParameterChange () |
Detailed description is given in specification of GaAlgorithm::BeginParameterChange method. | |
virtual const GaStopCriteriaPair &GACALL | StopCriteria () const |
Detailed description is given in specification of GaAlgorithm::StopCriteria method. | |
virtual void GACALL | SetStopCriteria (GaStopCriteria *criteria, GaStopCriteriaParams *parameters) |
Detailed description is given in specification of GaAlgorithm::SetStopCriteria method. | |
virtual void GACALL | SetStopCriteriaParams (GaStopCriteriaParams *parameters) |
Detailed description is given in specification of GaAlgorithm::SetStopCriteriaParams method. | |
virtual GaAlgorithmState GACALL | GetState () const |
Detailed description is given in specification of GaAlgorithm::GetState method. | |
virtual void GACALL | SubscribeObserver (GaObserver *observer) |
Detailed description is given in specification of GaAlgorithm::SubscribeObserver method. | |
virtual void GACALL | UnsubscribeObserver (GaObserver *observer) |
Detailed description is given in specification of GaAlgorithm::UnsubscribeObserver method. | |
Protected Member Functions | |
virtual GAL_API bool GACALL | CheckStopCriteria () |
This method checks current state of the algorithm against desired state specified by stop criteria and if the state is reached it stops execution of algorithm. | |
virtual void GACALL | Initialize ()=0 |
This method is called when user has successfully started new execution. It should restart previous state and results and initialize and prepares populations, statistical information and other data and control structures. | |
virtual bool GACALL | OnStart ()=0 |
OnStart method is called when user has successfully started new execution. This method is called after Initialize method. | |
virtual bool GACALL | OnStop ()=0 |
OnStop method is called when user requests stopping of execution. | |
virtual bool GACALL | OnPause ()=0 |
OnPause method is called when user requests pausing of execution. | |
virtual bool GACALL | OnResume ()=0 |
OnResume method is called when user has successfully resumed previously paused execution. | |
virtual void GACALL | BlockParameterChanges () |
Detailed description is given in specification of GaAlgorithm::BlockParameterChanges method. | |
virtual void GACALL | ReleaseParameterChanages () |
Detailed description is given in specification of GaAlgorithm::ReleaseParameterChanages method. | |
virtual void GACALL | BlockStateChange () |
This method should be called within algorithm when it enters critical section in which it cannot handle any state changes of its execution. This call should be fallowed by ReleaseStateChange call when algorithm exits critical section. | |
virtual void GACALL | ReleaseStateChange () |
This method should be called within algorithm when it exits critical section it is able to handle state changes of its execution. | |
Protected Attributes | |
GaAlgorithmState | _state |
Algorithm's execution state. | |
GaStopCriteriaPair | _stopCriteria |
Stores referenc to stop criteria and its parameters. | |
GaCriticalSection | _syncParameterChanges |
Critical section object for synchronization of parameters and operations changes from multiple threads. | |
GaCriticalSection | _syncStateChange |
Critical section object is used for synchronization of algorithm's execution state changes from multiple threads. | |
GaObserversList | _observers |
List of observers which are subscribed to events of this algorithm. |
This class has no built-in synchronizator, so LOCK_OBJECT
and LOCK_THIS_OBJECT
macros cannot be used with instances of this class, but all public method and operators are thread-safe.
Next diagram show possible states of algorithm's execution and transitions.
Algorithm::GaBaseAlgorithm::GaBaseAlgorithm | ( | ) | [inline] |
This constructor sets initial state of algorithm's execution.
void Algorithm::GaBaseAlgorithm::StartSolving | ( | bool | continueSolving | ) | [virtual] |
Detailed description is given in specification of GaAlgorithm::StartSolving method. Diagram shows when this method can be called.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
void Algorithm::GaBaseAlgorithm::StopSolving | ( | ) | [virtual] |
Detailed description is given in specification of GaAlgorithm::StopSolving method. Diagram shows when this method can be called.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
void Algorithm::GaBaseAlgorithm::PauseSolving | ( | ) | [virtual] |
Detailed description is given in specification of GaAlgorithm::PauseSolving method. Diagram shows when this method can be called.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::BeginParameterChange | ( | ) | [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::BeginParameterChange method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::EndParameterChange | ( | ) | [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::BeginParameterChange method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual const GaStopCriteriaPair& GACALL Algorithm::GaBaseAlgorithm::StopCriteria | ( | ) | const [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::StopCriteria method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::SetStopCriteria | ( | GaStopCriteria * | criteria, | |
GaStopCriteriaParams * | parameters | |||
) | [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::SetStopCriteria method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::SetStopCriteriaParams | ( | GaStopCriteriaParams * | parameters | ) | [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::SetStopCriteriaParams method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual GaAlgorithmState GACALL Algorithm::GaBaseAlgorithm::GetState | ( | ) | const [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::GetState method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::SubscribeObserver | ( | GaObserver * | observer | ) | [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::SubscribeObserver method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::UnsubscribeObserver | ( | GaObserver * | observer | ) | [inline, virtual] |
Detailed description is given in specification of GaAlgorithm::UnsubscribeObserver method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
bool Algorithm::GaBaseAlgorithm::CheckStopCriteria | ( | ) | [protected, virtual] |
This method checks current state of the algorithm against desired state specified by stop criteria and if the state is reached it stops execution of algorithm.
This method is not thread-safe.
virtual void GACALL Algorithm::GaBaseAlgorithm::Initialize | ( | ) | [protected, pure virtual] |
This method is called when user has successfully started new execution. It should restart previous state and results and initialize and prepares populations, statistical information and other data and control structures.
This method is not thread-safe.
Implemented in Algorithm::SimpleAlgorithms::GaIncrementalAlgorithm, and Algorithm::SimpleAlgorithms::GaSimpleAlgorithm.
virtual bool GACALL Algorithm::GaBaseAlgorithm::OnStart | ( | ) | [protected, pure virtual] |
OnStart
method is called when user has successfully started new execution. This method is called after Initialize method.
true
if algorithm is started succesafully.Implemented in Algorithm::GaMultithreadingAlgorithm.
virtual bool GACALL Algorithm::GaBaseAlgorithm::OnStop | ( | ) | [protected, pure virtual] |
OnStop
method is called when user requests stopping of execution.
true
if algorithm is stopped succesafully.Implemented in Algorithm::GaMultithreadingAlgorithm.
virtual bool GACALL Algorithm::GaBaseAlgorithm::OnPause | ( | ) | [protected, pure virtual] |
OnPause
method is called when user requests pausing of execution.
true
if algorithm is paused succesafully.Implemented in Algorithm::GaMultithreadingAlgorithm.
virtual bool GACALL Algorithm::GaBaseAlgorithm::OnResume | ( | ) | [protected, pure virtual] |
OnResume
method is called when user has successfully resumed previously paused execution.
true
if algorithm is resumed succesafully.Implemented in Algorithm::GaMultithreadingAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::BlockParameterChanges | ( | ) | [inline, protected, virtual] |
Detailed description is given in specification of GaAlgorithm::BlockParameterChanges method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::ReleaseParameterChanages | ( | ) | [inline, protected, virtual] |
Detailed description is given in specification of GaAlgorithm::ReleaseParameterChanages method.
This method is thread-safe.
Implements Algorithm::GaAlgorithm.
virtual void GACALL Algorithm::GaBaseAlgorithm::BlockStateChange | ( | ) | [inline, protected, virtual] |
This method should be called within algorithm when it enters critical section in which it cannot handle any state changes of its execution. This call should be fallowed by ReleaseStateChange call when algorithm exits critical section.
This method is thread-safe.
virtual void GACALL Algorithm::GaBaseAlgorithm::ReleaseStateChange | ( | ) | [inline, protected, virtual] |
This method should be called within algorithm when it exits critical section it is able to handle state changes of its execution.
This method is thread-safe.
GaAlgorithmState Algorithm::GaBaseAlgorithm::_state [protected] |
Algorithm's execution state.
Stores referenc to stop criteria and its parameters.
Critical section object for synchronization of parameters and operations changes from multiple threads.
Critical section object is used for synchronization of algorithm's execution state changes from multiple threads.
List of observers which are subscribed to events of this algorithm.