MCScheduling 1.0
Set of Algorithms for Solving Mixed-Criticality Scheduling
|
The basic implementation of the IChromosomePool interface. More...
Public Member Functions | |
CChromosomePool () | |
Creates a new chromosome pool with the maximum size of 64 instances. | |
CChromosomePool (int size) | |
Creates a new chromosome pool with the specified maximum size. | |
IChromosome | acquire () |
Returns a chromosome from the pool. | |
void | release (IChromosome chromosome) |
Puts the specified chromosome into the pool so it may be reused. | |
void | setMaximumSize (int size) |
Sets the capacity of the pool. | |
void | clear () |
Empties the chromosome pool. |
The basic implementation of the IChromosomePool interface.
The pool is represented by a dynamic list of chromosomes.
IChromosome MCScheduling.GeneticAlgorithm.CChromosomePool.acquire | ( | ) |
Returns a chromosome from the pool.
If the pool is empty, null is returned.
Implements MCScheduling.GeneticAlgorithm.IChromosomePool.
void MCScheduling.GeneticAlgorithm.CChromosomePool.release | ( | IChromosome | chromosome | ) |
Puts the specified chromosome into the pool so it may be reused.
chromosome | The chromosome to be added into the pool. |
Implements MCScheduling.GeneticAlgorithm.IChromosomePool.
void MCScheduling.GeneticAlgorithm.CChromosomePool.setMaximumSize | ( | int | size | ) |
Sets the capacity of the pool.
Any chromosome added when the pool is at its maximum capacity is discarded.
size | The size of the pool. |
Implements MCScheduling.GeneticAlgorithm.IChromosomePool.