Biorithm  1.1
Public Member Functions | Protected Attributes
MySimulatedAnnealer< AnnealState > Class Template Reference

A generic class for performing simulated annealing. It is templated by two classes: AnnealState stores information on a "state", e.g., a heavy path or a heavy subgraph, and AnnealMethod a class that takes a state and computes its neighbours. More...

#include <anneal.h>

List of all members.

Public Member Functions

 MySimulatedAnnealer (const AnnealState &s)
bool acceptNeighbour (MyNT score)
MyNT computeBestScore (const vector< AnnealState > &neighbours, AnnealState &bestNeighbour)
void decreaseTemperature ()
void getFinalState (AnnealState &finalState) const
void initialise ()
bool isDone ()
 Return true if the number of iterations equals the maximum allowed.
void setNumTotalIterations (unsigned int num)
 Set the total number of annealing steps to perform.
void run ()
 Run the simulated annealing algorithm.
void setInitialState (AnnealState &s)
 Set the initial state.

Protected Attributes

MyNT _startTemperature
MyNT _endTemperature
MyNT _dropTemperature
unsigned int _numMaxIterations
unsigned int _numMaxIterationsWithoutImprovement
MyNT _bestScore
MyNT _currentTemperature
unsigned int _numTotalIterations
unsigned int _numIterationsWithScoreDecrease
unsigned int _numIterationsWithoutImprovement
AnnealState _startState
AnnealState _currentState

Detailed Description

template<typename AnnealState>
class MySimulatedAnnealer< AnnealState >

A generic class for performing simulated annealing. It is templated by two classes: AnnealState stores information on a "state", e.g., a heavy path or a heavy subgraph, and AnnealMethod a class that takes a state and computes its neighbours.


Member Function Documentation

template<typename AnnealState >
void MySimulatedAnnealer< AnnealState >::run ( ) [inline]

Run the simulated annealing algorithm.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Friends