Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Wang_Landau< Physical_System, Move_Set_Traits, WL_DS_, NumCores > Class Template Reference


This is the main class that runs a Wang-Landau simulation. More...

#include <Wang_Landau.hpp>

Classes

class  Parameters
 
struct  Roll_Back_Restoration_Point
 Informotion used to roll back, including the states for random number generators. More...
 
struct  Snapshot
 
class  WL_DS_Interface
 Class used by the move set controllers (one for each move set), to access information stored in the DS Nb: for WL, there is a single move set, the combined one. More...
 

Public Types

using WL_DS = WL_DS_
 
typedef Move_Set_Traits::template Move_Set< typename Physical_System::Conformation > Move_Set
 
typedef Move_Set::Move_Stats Move_Stats
 
typedef Move_Set_Traits::template Controller< typename Physical_System::Conformation > Move_Set_Controller
 
typedef WL_DS::DS_conformation DS_Conformation
 
typedef WL_DS::Initial_Parameters WL_DS_Parameters
 
typedef std::array< typename Physical_System::Initial_Parameters, NumCores > Physical_systems_parameters
 
typedef std::array< typename Move_Set_Controller::Parameters, NumCores > MS_controllers_parameters
 
typedef std::array< typename Move_Set::Parameters, NumCores > Move_Set_Parameters
 

Public Member Functions

 T_Wang_Landau (Parameters parameters, WL_DS_Parameters ds_params, Physical_systems_parameters physical_sys_params, MS_controllers_parameters ms_controller_params, Move_Set_Parameters ms_params)
 
virtual ~T_Wang_Landau ()
 
void run_WL (uint64_t maxSteps)
 
const WL_DSget_data_structure () const
 get_data_structure More...
 
const std::shared_ptr< Parametersget_parameters () const
 
const std::vector< Snapshot > & get_snapshots () const
 

Protected Member Functions

double ratio_density (typename Physical_System::Conformation *A, typename Physical_System::Conformation *B)
 
virtual bool update_adaptivity_parameters ()
 
virtual void save_snapshot (typename WL_DS::Snapshot_ptr &&snapshot)
 
bool metropolis_hastings (const Bin_index &i1, const Bin_index &i2, const double &selection_correction, const unsigned int &chain_id)
 
virtual std::tuple< double, bool, bool, Move_Statssample_next_point (int core_number, bool slow_boundary_check)
 
bool sample_next_points (bool slow_boundary_check)
 
bool are_current_conformations_within_space_region ()
 
void conformation_out_of_space_region ()
 
virtual void create_restoration_pt ()
 
virtual void restore_from_restoration_pt ()
 

Protected Attributes

std::array< DS_Conformation, NumCores > current_ds_conformations
 
std::array< DS_Conformation, NumCores > next_ds_conformations
 
std::array< typename Physical_System::Conformation, NumCores > conformationA
 
std::array< typename Physical_System::Conformation, NumCores > conformationB
 
Roll_Back_Restoration_Point restoration_pt
 
uint64_t num_steps
 
std::array< std::mt19937, NumCores > metropolis_rng
 
std::array< std::uniform_real_distribution< double >, NumCores > unif_distribution
 
std::array< Physical_System *, NumCores > physical_systems
 
std::array< Move_Set, NumCores > move_sets
 
std::array< Move_Set_Controller, NumCores > move_set_controllers
 
std::shared_ptr< ParametersmParams
 
double next_save_point
 
WL_DS WL_ds
 
std::vector< Snapshotsnapshot_vector
 

Detailed Description

template<class Physical_System, class Move_Set_Traits, class WL_DS_ = T_WL_Data_Structure_MS<typename Physical_System::Conformation, typename Move_Set_Traits::template Controller<typename Physical_System::Conformation>>, int NumCores = 1>
class SBL::GT::T_Wang_Landau< Physical_System, Move_Set_Traits, WL_DS_, NumCores >


This is the main class that runs a Wang-Landau simulation.

Requires a Physical System and Move set Traits template parameter–but a default WL Data Structure is provided.

Template Parameters
Physical_System.
Move_set_Traits.
WL_DS.

Class Documentation

◆ SBL::GT::T_Wang_Landau::Parameters

class SBL::GT::T_Wang_Landau::Parameters

template<class Physical_System, class Move_Set_Traits, class WL_DS_ = T_WL_Data_Structure_MS<typename Physical_System::Conformation, typename Move_Set_Traits::template Controller<typename Physical_System::Conformation>>, int NumCores = 1>
class SBL::GT::T_Wang_Landau< Physical_System, Move_Set_Traits, WL_DS_, NumCores >::Parameters

Class Members
int debug_display_rate
int roll_back_check_frequency
int save_frequency
double save_rate
DoS_save_frequency_type save_type

◆ SBL::GT::T_Wang_Landau::Roll_Back_Restoration_Point

struct SBL::GT::T_Wang_Landau::Roll_Back_Restoration_Point

template<class Physical_System, class Move_Set_Traits, class WL_DS_ = T_WL_Data_Structure_MS<typename Physical_System::Conformation, typename Move_Set_Traits::template Controller<typename Physical_System::Conformation>>, int NumCores = 1>
struct SBL::GT::T_Wang_Landau< Physical_System, Move_Set_Traits, WL_DS_, NumCores >::Roll_Back_Restoration_Point

Informotion used to roll back, including the states for random number generators.

Class Members
array< typename Conformation, NumCores > conformationA
array< typename Conformation, NumCores > conformationB
array< DS_Conformation, NumCores > current_ds_conformations
Snapshot_ptr DS_snapshot
array< mt19937, NumCores > metropolis_rng
array< Move_Set_Controller, NumCores > move_set_controllers
array< Move_Set, NumCores > move_sets
array< DS_Conformation, NumCores > next_ds_conformations
double next_save_point
uint64_t num_steps
array< uniform_real_distribution< double >, NumCores > unif_distribution

◆ SBL::GT::T_Wang_Landau::Snapshot

struct SBL::GT::T_Wang_Landau::Snapshot

template<class Physical_System, class Move_Set_Traits, class WL_DS_ = T_WL_Data_Structure_MS<typename Physical_System::Conformation, typename Move_Set_Traits::template Controller<typename Physical_System::Conformation>>, int NumCores = 1>
struct SBL::GT::T_Wang_Landau< Physical_System, Move_Set_Traits, WL_DS_, NumCores >::Snapshot

Class Members
DS_snapshot ds_snapshot

Member Typedef Documentation

◆ DS_Conformation

typedef WL_DS::DS_conformation DS_Conformation

◆ Move_Set

typedef Move_Set_Traits::template Move_Set<typename Physical_System::Conformation> Move_Set

◆ Move_Set_Controller

typedef Move_Set_Traits::template Controller<typename Physical_System::Conformation> Move_Set_Controller

◆ Move_Set_Parameters

typedef std::array<typename Move_Set::Parameters,NumCores> Move_Set_Parameters

◆ Move_Stats

typedef Move_Set::Move_Stats Move_Stats

◆ MS_controllers_parameters

typedef std::array<typename Move_Set_Controller::Parameters,NumCores> MS_controllers_parameters

◆ Physical_systems_parameters

typedef std::array<typename Physical_System::Initial_Parameters,NumCores> Physical_systems_parameters

◆ WL_DS

using WL_DS = WL_DS_

◆ WL_DS_Parameters

typedef WL_DS::Initial_Parameters WL_DS_Parameters

Constructor & Destructor Documentation

◆ T_Wang_Landau()

T_Wang_Landau ( Parameters  parameters,
WL_DS_Parameters  ds_params,
Physical_systems_parameters  physical_sys_params,
MS_controllers_parameters  ms_controller_params,
Move_Set_Parameters  ms_params 
)

◆ ~T_Wang_Landau()

~T_Wang_Landau
virtual

Member Function Documentation

◆ are_current_conformations_within_space_region()

bool are_current_conformations_within_space_region
protected

◆ conformation_out_of_space_region()

void conformation_out_of_space_region
protected

◆ create_restoration_pt()

void create_restoration_pt
protectedvirtual

◆ get_data_structure()

const WL_DS& get_data_structure ( ) const
inline

get_data_structure

Returns
the data structure where all the info should be saved. WARNING: does not return a copy!

◆ get_parameters()

const std::shared_ptr<Parameters> get_parameters ( ) const
inline

◆ get_snapshots()

const std::vector<Snapshot>& get_snapshots ( ) const
inline

◆ metropolis_hastings()

bool metropolis_hastings ( const Bin_index i1,
const Bin_index i2,
const double &  selection_correction,
const unsigned int &  chain_id 
)
protected

◆ ratio_density()

double ratio_density ( typename Physical_System::Conformation *  A,
typename Physical_System::Conformation *  B 
)
inlineprotected

◆ restore_from_restoration_pt()

void restore_from_restoration_pt
protectedvirtual

◆ run_WL()

void run_WL ( uint64_t  maxSteps)

Run the Wang landau algorithm. Note: if one wants to launch the algorithm twice with the same parameters, this class should be instanciated twice, and one should not call twice this function on the same instance.

Parameters
[in]maxStepsnumber of steps of the algorithm

◆ sample_next_point()

std::tuple< double, bool, bool, typename T_Wang_Landau< Physical_System, Move_Set_Traits, WL_DS, NumCores >::Move_Stats > sample_next_point ( int  core_number,
bool  slow_boundary_check 
)
protectedvirtual

◆ sample_next_points()

bool sample_next_points ( bool  slow_boundary_check)
protected

◆ save_snapshot()

virtual void save_snapshot ( typename WL_DS::Snapshot_ptr &&  snapshot)
inlineprotectedvirtual

◆ update_adaptivity_parameters()

bool update_adaptivity_parameters
protectedvirtual

Member Data Documentation

◆ conformationA

std::array<typename Physical_System::Conformation,NumCores> conformationA
protected

◆ conformationB

std::array<typename Physical_System::Conformation,NumCores> conformationB
protected

◆ current_ds_conformations

std::array<DS_Conformation, NumCores> current_ds_conformations
protected

◆ metropolis_rng

std::array<std::mt19937,NumCores> metropolis_rng
protected

◆ move_set_controllers

std::array<Move_Set_Controller, NumCores> move_set_controllers
protected

◆ move_sets

std::array<Move_Set, NumCores> move_sets
protected

◆ mParams

std::shared_ptr<Parameters> mParams
protected

◆ next_ds_conformations

std::array<DS_Conformation, NumCores> next_ds_conformations
protected

◆ next_save_point

double next_save_point
protected

◆ num_steps

uint64_t num_steps
protected

◆ physical_systems

std::array<Physical_System*, NumCores> physical_systems
protected

◆ restoration_pt

Roll_Back_Restoration_Point restoration_pt
protected

◆ snapshot_vector

std::vector<Snapshot> snapshot_vector
protected

◆ unif_distribution

std::array<std::uniform_real_distribution<double>,NumCores> unif_distribution
protected

◆ WL_ds

WL_DS WL_ds
protected