oILAB
Loading...
Searching...
No Matches
EvolutionAlgorithmImplementation.h
Go to the documentation of this file.
1
//
2
// Created by Nikhil Chandra Admal on 8/14/24.
3
//
4
5
#ifndef OILAB_EVOLUTIONALGORITHMIMPLEMENTATION_H
6
#define OILAB_EVOLUTIONALGORITHMIMPLEMENTATION_H
7
8
#include <
randomInteger.h
>
9
#include <
OrderedTuplet.h
>
10
#include <
CanonicalTP.h
>
11
#include <
LandauWangTP.h
>
12
#include <
GbMesoState.h
>
13
14
namespace
gbLAB
{
15
template
<
typename
StateType,
typename
SystemType,
typename
TransitionProbabilityType>
16
EvolutionAlgorithm<StateType, SystemType, TransitionProbabilityType>::EvolutionAlgorithm
() :
17
transitionProbability(static_cast<TransitionProbabilityType &>(*this))
18
{ }
19
20
template
<
typename
StateType,
typename
SystemType,
typename
TransitionProbabilityType>
21
bool
EvolutionAlgorithm<StateType, SystemType, TransitionProbabilityType>::acceptMove
(
const
std::pair<StateType,SystemType>& proposedStateSystem,
22
const
std::pair<StateType,SystemType>& currentStateSystem)
const
23
{
24
double
probability = transitionProbability.probability(proposedStateSystem,currentStateSystem);
25
if
(random<double>(0.0, 1.0) <= probability)
26
return
true
;
27
else
28
return
false
;
29
}
30
31
}
32
#endif
CanonicalTP.h
GbMesoState.h
LandauWangTP.h
OrderedTuplet.h
gbLAB::EvolutionAlgorithm::acceptMove
bool acceptMove(const std::pair< StateType, SystemType > &proposedStateSystem, const std::pair< StateType, SystemType > ¤tStateSystem) const
Definition
EvolutionAlgorithmImplementation.h:21
gbLAB::EvolutionAlgorithm::EvolutionAlgorithm
EvolutionAlgorithm()
Definition
EvolutionAlgorithmImplementation.h:16
gbLAB
Definition
BiCrystal.cpp:13
randomInteger.h
include
MonteCarlo
EvolutionAlgorithmImplementation.h
Generated on Wed Aug 6 2025 23:06:44 for oILAB by
1.9.8