IGLib
1.5
The IGLib base library EXTENDED - with other lilbraries and applications.
|
A case of simulated annealing. More...
Public Member Functions | |
void | ShiftALink () |
Picks out a random link and shifts it a notch up or down. If the resulting change in potential energy is negative, the shift will take place. If it is positive, the shift will take place with a probability proportional to the falling exponential distribution. More... | |
void | SimulatedAnnealing () |
MolecularCatenary () | |
![]() | |
PlotZedgraphCurve | NewCurveFromPlottableData (PlotterZedGraph plotter, int x, int y) |
Creates a new PlotZedgraphCurve object from the available plottable data. More... | |
void | LoadPlottableDataToCurve (PlotZedgraphCurve curve, int x, int y) |
Copies the calculated data to the existing PlotZedgraphCurve object. Enough space must be available on the curve object's list. More... | |
Protected Attributes | |
PlotHQ | _plothq1 |
PlotZedgraphCurve | _curve1 |
double | _initialBeta = 0.01 |
double | _finalBeta = 30 |
int | _stepsAtTemperature = 5000 |
int | _coolingLevels = 7 |
double | _gamma |
The factor for which the inverse temperature beta rises after each cooling level. The inverse alpha, where alpha is the analogous factor asocciated with the gradual fall of the temperature. More... | |
int | _plotEveryNShifts = 50 |
![]() | |
string | _title |
Properties | |
List< double[]> | LinkPositions [get, set] |
Holds the positions of all the links of the molecular chain. The coordinates are integers. More... | |
int | NLinks [get, set] |
The number of links, including the two static (fastened) ones at the boundary. More... | |
double | PotentialEnergy [get, set] |
The current potential energy of the molecular chain. More... | |
double | A [get, set] |
The constant accompanying the gravitational potential energy. More... | |
double | B [get, set] |
The constant accompanying the elastic potential energy. More... | |
double | Beta [get, set] |
The parameter beta of the falling exponential (Boltzmann) distribution. The "inverse" temperature. More... | |
PlotHQ | PlotHQ1 [get, set] |
The chain's own plotting window. Displays the chain's current state. This is used across two threads. More... | |
PlotZedgraphCurve | Curve1 [get, set] |
The chain object on the Plotter (PlotHQ). Used across two threads. More... | |
double | InitialBeta [get, set] |
The initial inverse temperature for the simulated annealing process. More... | |
double | FinalBeta [get, set] |
The final inverse temperature for the simulated annealing process. More... | |
int | StepsAtTemperature [get, set] |
How many chain link shifts the method will make at a certain temperature. More... | |
int | CoolingLevels [get, set] |
How granular the cooling will be. Example: T0 = 1000, TN=100, CoolingLevels = 10: 1000, 900, 800, ..., 200, 100. More levels means higher reliability, but also more time wasted. More... | |
int | PlotEveryNShifts [get, set] |
How often the plotting window should refresh. A smaller number means more often and makes it more interesting. However, a bigger number makes the whole calculation much faster. More... | |
![]() | |
string | Title [get, set] |
The plottable model's name. Also used as a plot title. More... | |
List< double[]> | PlottableData [get, set] |
The main solution array, which is used by the plotter. More... | |
Private Member Functions | |
void | ShowPlot () |
The plotting thread. The plotter must be initialized on the same thread it will be shown on. More... | |
Private Attributes | |
List< double[]> | _linkPositions |
int | _nLinks |
double | _potentialEnergy = 0 |
double | _A = 1 |
double | _B = 0.3 |
double | _beta = 0.3 |
Random | _rng = new Random() |
An all-purpose RNG. More... | |
int | _linkNumber |
Which link get's picked to be shifted. More... | |
double | _oldEnergy |
The potential energy of the system before the link shift. More... | |
double | _energyChange |
The difference between the new and the old energy. More... | |
int | _shiftDirection |
Indicates whether to shift the link up or down. Can be either +1 or -1. More... | |
double | _diceRoll |
A random real number between 0 and 1. Used for the simulated annealing (Boltzmann) criterion. More... | |
readonly object | _locker = new object() |
A locker for wait/pulse methods. More... | |
bool | _go = false |
A blocking condition for the wait/pulse methods. More... | |
A case of simulated annealing.
|
inline |
|
inline |
Picks out a random link and shifts it a notch up or down. If the resulting change in potential energy is negative, the shift will take place. If it is positive, the shift will take place with a probability proportional to the falling exponential distribution.
Referenced by IG.MPetekLib.Application.Scripts.CompPhys._01AnnealingCatenary.Run().
|
inline |
|
inlineprivate |
The plotting thread. The plotter must be initialized on the same thread it will be shown on.
References IG.Gr.PlotterZedGraph.IsShowPointValues, IG.MPetekLib.Algorithms.Plotting.PlotHQ.Plotter, IG.Gr.PlotterZedGraph.SetBounds(), IG.MPetekLib.Algorithms.Plotting.PlotHQ.ShowPlot(), IG.Gr.PlotterZedGraph.Title, IG.MPetekLib.Algorithms.Plotting.PlotHQ.Window, IG.Gr.PlotterZedGraph.Window, IG.Gr.PlotterZedGraph.WindowHeight, and IG.Gr.PlotterZedGraph.WindowWidth.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
protected |
|
private |
An all-purpose RNG.
|
private |
Which link get's picked to be shifted.
|
private |
The potential energy of the system before the link shift.
|
private |
The difference between the new and the old energy.
|
private |
Indicates whether to shift the link up or down. Can be either +1 or -1.
|
private |
A random real number between 0 and 1. Used for the simulated annealing (Boltzmann) criterion.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The factor for which the inverse temperature beta rises after each cooling level. The inverse alpha, where alpha is the analogous factor asocciated with the gradual fall of the temperature.
|
protected |
|
private |
A locker for wait/pulse methods.
|
private |
A blocking condition for the wait/pulse methods.
|
getset |
Holds the positions of all the links of the molecular chain. The coordinates are integers.
|
getset |
The number of links, including the two static (fastened) ones at the boundary.
|
getset |
The current potential energy of the molecular chain.
Referenced by IG.MPetekLib.Application.Scripts.CompPhys._01AnnealingCatenary.Run().
|
getset |
The constant accompanying the gravitational potential energy.
|
getset |
The constant accompanying the elastic potential energy.
|
getset |
The parameter beta of the falling exponential (Boltzmann) distribution. The "inverse" temperature.
Referenced by IG.MPetekLib.Application.Scripts.CompPhys._01AnnealingCatenary.Run().
|
getset |
The chain's own plotting window. Displays the chain's current state. This is used across two threads.
|
getset |
The chain object on the Plotter (PlotHQ). Used across two threads.
|
getset |
The initial inverse temperature for the simulated annealing process.
|
getset |
The final inverse temperature for the simulated annealing process.
|
getset |
How many chain link shifts the method will make at a certain temperature.
|
getset |
How granular the cooling will be. Example: T0 = 1000, TN=100, CoolingLevels = 10: 1000, 900, 800, ..., 200, 100. More levels means higher reliability, but also more time wasted.
|
getset |
How often the plotting window should refresh. A smaller number means more often and makes it more interesting. However, a bigger number makes the whole calculation much faster.