Biorithm  1.1
Public Member Functions
MyAbstractAnnealState Class Reference

A class that abstracts the functionality of a state in simulated annealing. More...

#include <anneal.h>

Inheritance diagram for MyAbstractAnnealState:
MyDensestSubgraphAnnealState MyDensestSubgraphConnectedBruteForceAnnealState

List of all members.

Public Member Functions

 MyAbstractAnnealState ()
 The default constructor.
MyAbstractAnnealStateoperator= (const MyAbstractAnnealState &rhs)
virtual void computeRandomNeighbour (MyAbstractAnnealState &neighbour)=0
virtual MyNT computeScore () const =0
 Compute the score of the state.
virtual void print (ostream &ostr) const =0
 Print information about the state.
virtual void undo ()=0
 Undo the previous change made to the state.

Detailed Description

A class that abstracts the functionality of a state in simulated annealing.

Any instance of the MySimulatedAnnealer template class will be templated by a sub-class of MyAbstractAnnealState. Any sub-class of this class should implement the methods

  1. A constructor. Each sub-class will have to define any constructors with arguments.
  1. A virtual destructor.
  1. computeRandomNeighbour(): compute and return a random neighbour of the state.
  1. computeScore(): compute and return the score of the state.
  1. print(): print some information about the state.
  1. undo(): revert to the previous state.

Member Function Documentation

virtual void MyAbstractAnnealState::computeRandomNeighbour ( MyAbstractAnnealState neighbour) [pure virtual]

Compute a random neighbour of the state.

Note:
This method is not const since it may have to change the values of the members of MyAbstractAnnealState.

Implemented in MyDensestSubgraphConnectedBruteForceAnnealState, and MyDensestSubgraphAnnealState.

MyAbstractAnnealState& MyAbstractAnnealState::operator= ( const MyAbstractAnnealState rhs)

Don't define operator= to prevent assignment of this abstract base class.


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