Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Attributes | Private Types | Private Attributes | Static Private Attributes | List of all members
protocols::jd2::archive::ArchiveBase Class Referenceabstract

#include <ArchiveBase.hh>

Inheritance diagram for protocols::jd2::archive::ArchiveBase:
Inheritance graph
[legend]

Public Member Functions

 ArchiveBase (ArchiveManagerAP ptr=nullptr)
 
 ~ArchiveBase () override
 
bool finished () const override
 is archive converged ? More...
 
void initialize () override
 
void generate_batch () override=0
 create a new batch with manager().start_new_batch() and manager().finalize_batch(); More...
 
virtual bool add_structure (core::io::silent::SilentStructOP new_decoy, core::io::silent::SilentStructOP alternative_decoy, Batch const &)
 add structure to Archive.. return false if structure is rejected. More...
 
core::Size nstruct () const
 how many structures should be in archive .. varies from decoys().size() in startup phase. More...
 
void set_nstruct (core::Size set)
 set target size of pool More...
 
void save_to_file (std::string suffix="") override
 save and restore archive to file-system More...
 
void save_decoys (std::string const &dirname, std::string const &name, SilentStructs const &decoys)
 helper routine to save decoys properly More...
 
void load_decoys (std::string const &filename, SilentStructs &decoys)
 
bool restore_from_file () override
 restore archive More...
 
void save_status (std::ostream &) const override
 save and restore status of archive to file-system More...
 
virtual void restore_status (std::istream &)
 
void idle () override
 called when nothing is happening More...
 
void init_from_decoy_set (core::io::silent::SilentFileData const &sfd) override
 read externally provided structures from decoy_file into archive More...
 
void read_structures (core::io::silent::SilentFileData &, core::io::silent::SilentFileData &alternative_decoys, Batch const &batch) override
 SilentFileData contains the new structures belonging to this batch. More...
 
core::Sizeaccepts_since_last_batch ()
 
core::Size accepts_since_last_batch () const
 
core::Size proposed_since_last_batch () const
 
core::Real current_acceptance_ratio () const
 
void reset_accept_counter ()
 
core::Size total_proposed ()
 
core::Size total_accepts ()
 
bool statistics_valid ()
 
SilentStructs const & decoys () const
 
SilentStructsdecoys ()
 
- Public Member Functions inherited from protocols::jd2::archive::AbstractArchiveBase
 ~AbstractArchiveBase () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 AbstractArchiveBase (BaseArchiveManagerAP ptr)
 
 AbstractArchiveBase ()
 
virtual bool still_interested (jd2::archive::Batch const &) const
 old-batches might be outdated and should not be computed anymore return true for this query if this is the case for old_batch More...
 
virtual core::Size generate_batch (jd2::archive::Batch &, core::Size)
 create a batch for the current stage, return ct != 0 if more batches should be created at current stage. (e.g., harvest_batches) More...
 
void set_name (std::string const &set)
 set name of archive ( used also for save_to_file and restore_from_file ) More...
 
std::string const & name () const
 
BaseArchiveManagermanager ()
 access to the ArchiveManager (control of batches) More...
 
virtual void set_manager (BaseArchiveManagerAP manager)
 

Static Public Member Functions

static void register_options ()
 

Protected Types

typedef std::list
< core::io::silent::SilentStructOP
SilentStructs
 
typedef
SilentStructs::const_iterator 
const_decoy_iterator
 
typedef
SilentStructs::const_iterator 
decoy_iterator
 

Protected Member Functions

virtual void count_structure (Batch const &batch, bool accepted)
 count the structure for the acceptance statistics only count if not from expired batch More...
 
void count_removed_structures (core::Size n_removed)
 count the structure for the acceptance statistics only count if not from expired batch More...
 
void set_max_nstruct (core::Size setting)
 
core::Size max_nstruct ()
 
virtual void add_structure_at_position (SilentStructs::iterator iss, core::io::silent::SilentStructOP new_decoy, core::io::silent::SilentStructOP alternative_decoy)
 call to insert structure at position given by iterator More...
 
virtual void erase_decoy (std::string const &tag)
 
- Protected Member Functions inherited from protocols::jd2::archive::AbstractArchiveBase
BaseArchiveManagerAP manager_ptr ()
 

Static Protected Attributes

static std::string const TAG_IN_FILE
 
static std::string const SOURCE_FILE
 

Private Types

typedef std::deque< boolAcceptHistoryQueue
 

Private Attributes

core::Size max_nstruct_
 
core::Size nstruct_
 
SilentStructs decoys_
 
core::Size accepts_since_last_batch_
 
core::Size total_accepts_
 
core::Size proposed_since_last_batch_
 
core::Size total_proposed_
 
AcceptHistoryQueue acceptance_history_
 
core::Real floating_acceptance_ratio_
 
core::Size min_structures_for_acceptance_statistics_
 

Static Private Attributes

static bool options_registered_
 

Member Typedef Documentation

typedef SilentStructs::const_iterator protocols::jd2::archive::ArchiveBase::const_decoy_iterator
protected
typedef SilentStructs::const_iterator protocols::jd2::archive::ArchiveBase::decoy_iterator
protected

Constructor & Destructor Documentation

protocols::jd2::archive::ArchiveBase::ArchiveBase ( ArchiveManagerAP  ptr = nullptr)
protocols::jd2::archive::ArchiveBase::~ArchiveBase ( )
overridedefault

Member Function Documentation

core::Size& protocols::jd2::archive::ArchiveBase::accepts_since_last_batch ( )
inline

-— methods to keep statistics of acceptance

References accepts_since_last_batch_.

Referenced by count_removed_structures(), protocols::abinitio::IterativeBase::idle(), and total_accepts().

core::Size protocols::jd2::archive::ArchiveBase::accepts_since_last_batch ( ) const
inline
bool protocols::jd2::archive::ArchiveBase::add_structure ( core::io::silent::SilentStructOP  new_decoy,
core::io::silent::SilentStructOP  alternative_decoy,
Batch const &   
)
virtual

add structure to Archive.. return false if structure is rejected.

Reimplemented in protocols::abinitio::IterativeBase, and protocols::jd2::archive::EvaluatedArchive.

References add_structure_at_position(), and decoys_.

Referenced by read_structures().

void protocols::jd2::archive::ArchiveBase::add_structure_at_position ( SilentStructs::iterator  iss,
core::io::silent::SilentStructOP  new_decoy,
core::io::silent::SilentStructOP  alternative_decoy 
)
protectedvirtual
void protocols::jd2::archive::ArchiveBase::count_removed_structures ( core::Size  n_removed)
protected

count the structure for the acceptance statistics only count if not from expired batch

References acceptance_history_, accepts_since_last_batch(), decoys(), floating_acceptance_ratio_, min_structures_for_acceptance_statistics_, and nstruct_.

void protocols::jd2::archive::ArchiveBase::count_structure ( Batch const &  batch,
bool  accepted 
)
protectedvirtual
core::Real protocols::jd2::archive::ArchiveBase::current_acceptance_ratio ( ) const
inline
SilentStructs const& protocols::jd2::archive::ArchiveBase::decoys ( ) const
inline
SilentStructs& protocols::jd2::archive::ArchiveBase::decoys ( )
inline

References decoys_.

void protocols::jd2::archive::ArchiveBase::erase_decoy ( std::string const &  tag)
protectedvirtual
bool protocols::jd2::archive::ArchiveBase::finished ( ) const
inlineoverridevirtual

is archive converged ?

Implements protocols::jd2::archive::AbstractArchiveBase.

void protocols::jd2::archive::ArchiveBase::generate_batch ( )
overridepure virtual
void protocols::jd2::archive::ArchiveBase::idle ( )
inlineoverridevirtual

called when nothing is happening

Implements protocols::jd2::archive::AbstractArchiveBase.

void protocols::jd2::archive::ArchiveBase::init_from_decoy_set ( core::io::silent::SilentFileData const &  sfd)
overridevirtual
void protocols::jd2::archive::ArchiveBase::initialize ( )
inlineoverridevirtual
void protocols::jd2::archive::ArchiveBase::load_decoys ( std::string const &  filename,
SilentStructs decoys 
)
core::Size protocols::jd2::archive::ArchiveBase::max_nstruct ( )
inlineprotected

References max_nstruct_.

core::Size protocols::jd2::archive::ArchiveBase::nstruct ( ) const
inline
core::Size protocols::jd2::archive::ArchiveBase::proposed_since_last_batch ( ) const
inline
void protocols::jd2::archive::ArchiveBase::read_structures ( core::io::silent::SilentFileData sfd,
core::io::silent::SilentFileData alternative_decoys,
Batch const &  batch 
)
overridevirtual
void protocols::jd2::archive::ArchiveBase::register_options ( )
static
void protocols::jd2::archive::ArchiveBase::reset_accept_counter ( )
inline
bool protocols::jd2::archive::ArchiveBase::restore_from_file ( )
overridevirtual
void protocols::jd2::archive::ArchiveBase::restore_status ( std::istream &  is)
virtual
void protocols::jd2::archive::ArchiveBase::save_decoys ( std::string const &  dirname,
std::string const &  name,
SilentStructs const &  decoys 
)

helper routine to save decoys properly

References protocols::abinitio::filename(), and core::io::silent::SilentFileData::write_silent_struct().

Referenced by save_to_file().

void protocols::jd2::archive::ArchiveBase::save_status ( std::ostream &  os) const
overridevirtual
void protocols::jd2::archive::ArchiveBase::save_to_file ( std::string  suffix = "")
overridevirtual
void protocols::jd2::archive::ArchiveBase::set_max_nstruct ( core::Size  setting)
inlineprotected
void protocols::jd2::archive::ArchiveBase::set_nstruct ( core::Size  set)
inline

set target size of pool

References nstruct_.

bool protocols::jd2::archive::ArchiveBase::statistics_valid ( )
inline
core::Size protocols::jd2::archive::ArchiveBase::total_accepts ( )
inline
core::Size protocols::jd2::archive::ArchiveBase::total_proposed ( )
inline

Member Data Documentation

AcceptHistoryQueue protocols::jd2::archive::ArchiveBase::acceptance_history_
private
core::Size protocols::jd2::archive::ArchiveBase::accepts_since_last_batch_
private
SilentStructs protocols::jd2::archive::ArchiveBase::decoys_
private
core::Real protocols::jd2::archive::ArchiveBase::floating_acceptance_ratio_
private
core::Size protocols::jd2::archive::ArchiveBase::max_nstruct_
private
core::Size protocols::jd2::archive::ArchiveBase::min_structures_for_acceptance_statistics_
private
core::Size protocols::jd2::archive::ArchiveBase::nstruct_
private
bool protocols::jd2::archive::ArchiveBase::options_registered_
staticprivate

Referenced by ArchiveBase().

core::Size protocols::jd2::archive::ArchiveBase::proposed_since_last_batch_
private
std::string const protocols::jd2::archive::ArchiveBase::SOURCE_FILE
staticprotected

Referenced by read_structures().

std::string const protocols::jd2::archive::ArchiveBase::TAG_IN_FILE
staticprotected

Referenced by read_structures().

core::Size protocols::jd2::archive::ArchiveBase::total_accepts_
private
core::Size protocols::jd2::archive::ArchiveBase::total_proposed_
private

The documentation for this class was generated from the following files: