Class SimulatedAnnealingEvolver<TLayout, TNode, TConfiguration>
Implementation of a simulated annealing evolver.
Inheritance
System.Object
SimulatedAnnealingEvolver<TLayout, TNode, TConfiguration>
Assembly: Edgar.dll
Syntax
public class SimulatedAnnealingEvolver<TLayout, TNode, TConfiguration> : Object, ILayoutEvolver<TLayout, TNode>, IRandomInjectable, ICancellable where TLayout : ILayout<TNode, TConfiguration>, ISmartCloneable<TLayout> where TConfiguration : IConfiguration<IntAlias<PolygonGrid2D>, TNode>
Type Parameters
Name |
Description |
TLayout |
|
TNode |
|
TConfiguration |
|
Constructors
SimulatedAnnealingEvolver(IChainBasedLayoutOperations<TLayout, TNode>, SimulatedAnnealingConfiguration, Boolean)
Declaration
public SimulatedAnnealingEvolver(IChainBasedLayoutOperations<TLayout, TNode> layoutOperations, SimulatedAnnealingConfiguration configuration = null, bool addNodesGreedilyBeforeEvolve = false)
Parameters
SimulatedAnnealingEvolver(IChainBasedLayoutOperations<TLayout, TNode>, SimulatedAnnealingConfigurationProvider, Boolean)
Declaration
public SimulatedAnnealingEvolver(IChainBasedLayoutOperations<TLayout, TNode> layoutOperations, SimulatedAnnealingConfigurationProvider configurationProvider, bool addNodesGreedilyBeforeEvolve = false)
Parameters
Fields
CancellationToken
Declaration
protected Nullable<CancellationToken> CancellationToken
Field Value
Type |
Description |
System.Nullable<System.Threading.CancellationToken> |
|
Configuration
Declaration
protected SimulatedAnnealingConfiguration Configuration
Field Value
ConfigurationProvider
Declaration
protected SimulatedAnnealingConfigurationProvider ConfigurationProvider
Field Value
LayoutOperations
Declaration
protected IChainBasedLayoutOperations<TLayout, TNode> LayoutOperations
Field Value
Random
Declaration
Field Value
Type |
Description |
System.Random |
|
Methods
Evolve(TLayout, Chain<TNode>, Int32)
Returns valid layouts evolved from a given initial layout.
Declaration
public IEnumerable<TLayout> Evolve(TLayout initialLayout, Chain<TNode> chain, int count)
Parameters
Type |
Name |
Description |
TLayout |
initialLayout |
A layout that is used as the base for the evolution.
|
Chain<TNode> |
chain |
Only nodes from the chain should be perturbed.
|
System.Int32 |
count |
How many layouts should be produced.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TLayout> |
|
GetConfiguration(Int32)
Declaration
protected SimulatedAnnealingConfiguration GetConfiguration(int chainNumber)
Parameters
Type |
Name |
Description |
System.Int32 |
chainNumber |
|
Returns
InjectRandomGenerator(Random)
Declaration
public void InjectRandomGenerator(Random random)
Parameters
Type |
Name |
Description |
System.Random |
random |
|
SetCancellationToken(Nullable<CancellationToken>)
Declaration
public void SetCancellationToken(Nullable<CancellationToken> cancellationToken)
Parameters
Type |
Name |
Description |
System.Nullable<System.Threading.CancellationToken> |
cancellationToken |
|
SetRandomRestarts(Boolean, SimulatedAnnealingEvolver<TLayout, TNode, TConfiguration>.RestartSuccessPlace, Boolean, Single)
Set up random restarts strategy.
Declaration
public void SetRandomRestarts(bool enable, SimulatedAnnealingEvolver<TLayout, TNode, TConfiguration>.RestartSuccessPlace successPlace, bool resetCounter = false, float scale = 1F)
Parameters
Events
OnEvent
Declaration
public event EventHandler<SimulatedAnnealingEventArgs> OnEvent
Event Type
OnPerturbed
Declaration
public event EventHandler<TLayout> OnPerturbed
Event Type
Type |
Description |
System.EventHandler<TLayout> |
|
OnValid
Declaration
public event EventHandler<TLayout> OnValid
Event Type
Type |
Description |
System.EventHandler<TLayout> |
|
Implements