MCScheduling 1.0
Set of Algorithms for Solving Mixed-Criticality Scheduling
Classes | Public Member Functions | Protected Member Functions
MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T > Class Template Reference

The base simulated annealing algorithm. More...

Inheritance diagram for MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >:
MCScheduling.MixedCriticality.SA.CMixedCriticalitySimulatedAnnealing

List of all members.

Classes

class  CState
 The state keeps information about the energy of the actual state it wraps. More...

Public Member Functions

void setEvaluator (IEvaluator< T > evaluator)
 Sets the evaluator.
void setComparer (IComparer comparer)
 Sets the fitness score comparer.
void setAcceptor (IAcceptor acceptor)
 Sets the acceptor probability distribution method.
void setCooler (ICooler cooler)
 Sets the temperature cooling method.
void setPerturber (IPerturber< T > perturber)
 Sets the neighbour generating method.
void setMaximumTemperature (double maximumTemperature)
 Sets the maximum (starting) temperature for the simulated annealing.
double getMaximumTemperature ()
 Returns the maximum (starting) temperature of the simulated annealing algorithm.
void setMinimumTemperature (double minimumTemperature)
 Sets the minimum (ending) temperature for the simulated annealing.
double getMinimumTemperature ()
 Returns the minimum (ending) temperature of the simulated annealing algorithm.
void setRandomGenerator (IRandomizer randomizer)
 Sets the pseudo-random number generator for the simulated annealing algorithm.
IRandomizer getRandomGenerator ()
 Returns the random number generator used by the simulated annealing algorithm.
void setInterrupted (bool interrupted)
 Sets the interrupted flag on the specified value.
bool isInterrupted ()
 Returns the state of the interrupted flag.
solve (long iterationLimit, long timeLimit)
 Solves a problem using simulated annealing.

Protected Member Functions

 CBaseSimulatedAnnealing ()
 Initializes the basic simulated annealing method.
 CBaseSimulatedAnnealing (IRandomizer randomizer)
 Initializes the base simulated annealing method.
virtual void moveToNeighbour (ref CState state, double temperature)
 The metropolis algorithm.
abstract T InitialSolution ()
 Returns the initial solution.

Detailed Description

template<T>
class MCScheduling::SimulatedAnnealing::CBaseSimulatedAnnealing< T >

The base simulated annealing algorithm.

Parameters:
TThe type of solution.
Author:
Tomas Tunys
Type Constraints
T :ICloneable<T> 

Member Function Documentation

template<T >
MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.CBaseSimulatedAnnealing ( IRandomizer  randomizer) [protected]

Initializes the base simulated annealing method.

Parameters:
randomizerThe pseudo-random number generator to use.
template<T >
double MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.getMaximumTemperature ( )

Returns the maximum (starting) temperature of the simulated annealing algorithm.

Returns:
The maximum (starting) temperature of the simulated annealing algorithm.
template<T >
double MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.getMinimumTemperature ( )

Returns the minimum (ending) temperature of the simulated annealing algorithm.

Returns:
The minimum (ending) temperature of the simulated annealing algorithm.
template<T >
IRandomizer MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.getRandomGenerator ( )

Returns the random number generator used by the simulated annealing algorithm.

Returns:
The random number generator.
template<T >
abstract T MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.InitialSolution ( ) [protected, pure virtual]

Returns the initial solution.

Returns:
The initial solution.

Implemented in MCScheduling.MixedCriticality.SA.CMixedCriticalitySimulatedAnnealing.

template<T >
bool MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.isInterrupted ( )

Returns the state of the interrupted flag.

Returns:
True if the simulated annealing has been interrupted; otherwise it returns false.
template<T >
virtual void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.moveToNeighbour ( ref CState  state,
double  temperature 
) [protected, virtual]

The metropolis algorithm.

Returns a neighbouring state of the specified state.

Parameters:
stateThe current state.
temperatureThe temperature influencing probability of acceptance of a neighbouring state.

Reimplemented in MCScheduling.MixedCriticality.SA.CMixedCriticalitySimulatedAnnealing.

template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setAcceptor ( IAcceptor  acceptor)

Sets the acceptor probability distribution method.

Parameters:
acceptorThe acceptor.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setComparer ( IComparer  comparer)

Sets the fitness score comparer.

Parameters:
comparerThe comparer.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setCooler ( ICooler  cooler)

Sets the temperature cooling method.

Parameters:
coolerThe temperature cooling method.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setEvaluator ( IEvaluator< T >  evaluator)

Sets the evaluator.

Parameters:
evaluatorThe evaluator of states.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setInterrupted ( bool  interrupted)

Sets the interrupted flag on the specified value.

If the value is true, and the optimization process is currently running, then it is interrupted.

Parameters:
interruptedIf true, then the running optimization process is interrupted.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setMaximumTemperature ( double  maximumTemperature)

Sets the maximum (starting) temperature for the simulated annealing.

Parameters:
maximumTemperatureThe maximum temperature value.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setMinimumTemperature ( double  minimumTemperature)

Sets the minimum (ending) temperature for the simulated annealing.

Parameters:
minimumTemperatureThe minimum temperature value.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setPerturber ( IPerturber< T >  perturber)

Sets the neighbour generating method.

Parameters:
perturberA method generating a neighbouring state given a current state.
template<T >
void MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.setRandomGenerator ( IRandomizer  randomizer)

Sets the pseudo-random number generator for the simulated annealing algorithm.

Parameters:
randomizerThe random number generator.
template<T >
T MCScheduling.SimulatedAnnealing.CBaseSimulatedAnnealing< T >.solve ( long  iterationLimit,
long  timeLimit 
)

Solves a problem using simulated annealing.

The process is stopped after the specified number of iterations has been exceded or the specified number of miliseconds have passed, the temperature has dropped down to minimum temperature, or the process has been interrupted.

Parameters:
iterationLimitThe maximum number of iterations.
timeLimitThe maximum number of miliseconds.
Returns:
The state that represents a solution, or the last state when the algorithm has been stopped.
 All Classes Namespaces Functions Variables Properties