Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
core::conformation::parametric::RealValuedParameter Class Reference

RealValuedParameter class, used to store a single real-valued parameter for parametric backbone generation. More...

#include <RealValuedParameter.hh>

Inheritance diagram for core::conformation::parametric::RealValuedParameter:
Inheritance graph
[legend]

Public Member Functions

 RealValuedParameter ()
 constructors More...
 
 RealValuedParameter (RealValuedParameter const &src)
 
 ~RealValuedParameter () override
 
ParameterOP clone () const override
 Make a copy of this object ( allocate actual memory for it ) More...
 
core::Real const & value () const
 Get the value of this parameter. More...
 
core::Real const & default_value () const
 Get the default value of this parameter. More...
 
core::Real const & value_min () const
 Get the minimum value of this parameter. More...
 
core::Real const & value_max () const
 Get the maximum value of this parameter. More...
 
core::Size value_samples () const
 Get the samples. More...
 
RealPerturbationType perturbation_type () const
 Get the perturbation type. More...
 
core::Real const & perturbation_magnitude () const
 Get the perturbation magnitude of this parameter. More...
 
void set_input_is_angle_in_degrees (bool const setting)
 Set whether this parameter expects that its input is an angle in degrees. More...
 
void set_value (core::Real const &value_in, bool const ignore_use_degrees=false)
 Set the value of this parameter. More...
 
void set_default_value (core::Real const &value_in)
 Sets the initial value of this parameter, keeping the value_set_ boolean false. More...
 
void set_parameter_type (ParameterType const type_in) override
 Sets the parameter type. More...
 
void set_sampling_options (core::Real const &value_min_in, core::Real const &value_max_in, core::Size const samples_in)
 Set the options for sampling this parameter. More...
 
void set_perturbation_type (std::string const &pert_type_in)
 Set the perturbation type, by string. More...
 
void set_perturbation_type (RealPerturbationType const pert_type_in)
 Set the perturbation type, by enum. More...
 
void set_perturbation_options (core::Real const &pert_magnitude_in, std::string const &pert_type_in)
 Set the options for perturbing this parameter (with perturbation type set by string). More...
 
void set_perturbation_options (core::Real const &pert_magnitude_in, RealPerturbationType const pert_type_in)
 Set the options for perturbing this parameter (with perturbation type set by enum). More...
 
bool copy_value_from_parameter (ParameterCOP other_parameter, ParametersCOP other_parameter_collection, ParametersCOP this_parameter_collection) override
 Given another parameter of the same type, copy its value. This does not set value_set_ to true. More...
 
void parse_setting (utility::tag::TagCOP tag, bool const parse_setting, bool const parse_grid_sampling, bool const parse_perturbation, bool const parse_copying) override
 Given a tag, parse out the setting for this parameter. More...
 
void provide_xsd_information (utility::tag::AttributeList &xsd, bool const provide_setting, bool const provide_copying, bool const provide_grid_sampling, bool const provide_perturbation) const override
 Return the XSD information for this parameter. More...
 
void reset_sampling_and_perturbation_settings () override
 Reset the sampling and perturbation options before storing this Parameter object in a parametric Conformation. More...
 
void reset_value_settings () override
 Reset the value settings for this Parameter object. More...
 
bool perturbation_set () const
 Has the perturbation information for this parameter been set? More...
 
bool sampling_set () const
 Has the sampling information for this parameter been set? More...
 
core::Real generate_perturbed_value (core::Real const &current_value) const
 Given the current value of this parameter and the current perturbation settings, return a perturbed value. More...
 
- Public Member Functions inherited from core::conformation::parametric::Parameter
 Parameter ()
 constructors More...
 
ParameterCOP get_self_ptr () const
 Self pointers (const shared pointer). More...
 
ParameterOP get_self_ptr ()
 Self pointers (nonconst shared pointer). More...
 
ParameterCAP get_self_weak_ptr () const
 Self pointers (const weak pointer). More...
 
ParameterAP get_self_weak_ptr ()
 Self pointers (nonconst weak pointer). More...
 
std::string const & parameter_name () const
 Get parameter name. More...
 
std::string const & parameter_description () const
 Get parameter description. More...
 
std::string const & short_parameter_description () const
 Get short parameter description. More...
 
std::string const & parameter_units () const
 Get units. More...
 
ParameterType parameter_type () const
 Get the parameter type. More...
 
bool can_be_set () const
 Is this parameter one that can be set directly by the user? More...
 
bool can_be_copied () const
 Is this parameter one that can be copied from another parameter? More...
 
bool can_be_sampled () const
 Is this parameter one that can be sampled? More...
 
bool can_be_perturbed () const
 Is this parameter one that can be perturbed? More...
 
bool global_for_parameters_set () const
 Get whether this property is meant to be global for a parameters set. More...
 
std::string const & copy_suffix () const
 Get the suffix for the copy tag (e.g. "copies_helix" in the case of helical bundles). More...
 
core::Size copy_from_parameters_index () const
 Get the index of the Parameters object from which we will copy this parameter's value. More...
 
bool value_was_set () const
 Has the value been set? More...
 
bool copying_information_was_set () const
 Has the copying information been set? More...
 
void set_parameter_name (std::string const &name_in)
 Set parameter name. More...
 
void set_parameter_description (std::string const &description_in)
 Set parameter description. More...
 
void set_short_parameter_description (std::string const &short_description_in)
 Set short parameter description. More...
 
void set_parameter_units (std::string const &units_in)
 Set parameter units. More...
 
void set_can_be_set_sampled_perturbed_copied (bool const can_be_set, bool const can_be_copied, bool const can_be_sampled, bool const can_be_perturbed)
 Set whether this parameter is one that can be set directly by the user, whether it can be sampled, and whether it can be perturbed. More...
 
void set_global_for_parameters_set (bool const setting)
 Set whether this property is meant to be global for a parameters set. More...
 
void set_copy_suffix (std::string const &suffix_in)
 Set the suffix for the copy tag (e.g. "copies_helix" in the case of helical bundles). More...
 
void set_copy_from_parameters_index (core::Size const setting)
 Set the index of the Parameters object from which we will copy this parameter's value. More...
 
virtual void reset_copying_settings ()
 Reset the copying options. More...
 

Static Public Member Functions

static std::string const & perturbation_type_string_from_enum (RealPerturbationType const type_enum)
 Given a perturbation type enum, get the string for that enum. More...
 
static RealPerturbationType perturbation_type_enum_from_string (std::string const &type_string)
 Given a perturbation type string, get the enum for that string. More...
 

Protected Member Functions

void set_value_sneakily (core::Real const &value_in)
 Set the value without setting value_was_set_ = true. More...
 
void set_copy_information (utility::tag::TagCOP tag)
 Parse copy information from the tag, and set it. More...
 
virtual bool parse_setting_only (utility::tag::TagCOP tag, bool const parse_copying_too)
 Parse a setting for this parameter (e.g. r0="12.5"). More...
 
- Protected Member Functions inherited from core::conformation::parametric::Parameter
void set_value_was_set ()
 Allows derived classes to indicate that the value has been set. More...
 
void reset_value_was_set ()
 Allows derived classes to indicate that the value has not been set. More...
 

Private Member Functions

core::Real convert_angle (core::Real const &val) const
 Ensure that an angle value is in radians. More...
 
void provide_xsd_grid_sampling_information (utility::tag::AttributeList &xsd) const
 Return the XSD information for grid-sampling this parameter. More...
 
void provide_xsd_perturbation_information (utility::tag::AttributeList &xsd) const
 Return the XSD information for perturbing this parameter. More...
 
void provide_xsd_setting_information (utility::tag::AttributeList &xsd) const
 Return the XSD information for setting this parameter. More...
 
void provide_xsd_copying_information (utility::tag::AttributeList &xsd) const
 Return the XSD information for copying this parameter from another. More...
 
void correct_range ()
 If this is a parameter storing an angle, correct the value to be (-Pi:Pi]. Also, check that the value is positive if it is meant to be, or nonnegative if it is meant to be. More...
 
bool parse_grid_sampling_options (utility::tag::TagCOP tag)
 Parse a sampling range for this parameter (e.g. r0_min="12.3" r0_max="14.3" r0_samples="5"). More...
 
bool parse_perturbation_options (utility::tag::TagCOP tag)
 Parse perturbation options for this parameter (e.g. r0_perturbation="5.0" r0_perturbation_type="gaussian"). More...
 

Private Attributes

core::Real value_
 The value of this parameter. More...
 
core::Real default_value_
 The default value of this parameter. More...
 
bool default_value_was_set_
 Has the default value been set? More...
 
core::Real value_min_
 The min value to be sampled for this parameter. More...
 
core::Real value_max_
 The max value to be sampled for this parameter. More...
 
core::Size value_samples_
 The number of samples for this parameter. More...
 
core::Real perturbation_magnitude_
 The magnitude of the perturbation of this parameter. More...
 
RealPerturbationType perturbation_type_
 The perturbation type for this parameter. More...
 
bool sampling_set_
 Was the sampling range set? More...
 
bool perturbation_set_
 Were perturbation options set? More...
 
bool input_is_angle_in_degrees_
 Does this parameter expect that its input will be an angle in degrees? More...
 

Detailed Description

RealValuedParameter class, used to store a single real-valued parameter for parametric backbone generation.

Constructor & Destructor Documentation

core::conformation::parametric::RealValuedParameter::RealValuedParameter ( )
core::conformation::parametric::RealValuedParameter::RealValuedParameter ( RealValuedParameter const &  src)
core::conformation::parametric::RealValuedParameter::~RealValuedParameter ( )
override

Member Function Documentation

ParameterOP core::conformation::parametric::RealValuedParameter::clone ( ) const
overridevirtual

Make a copy of this object ( allocate actual memory for it )

Implements core::conformation::parametric::Parameter.

Reimplemented in protocols::helical_bundle::parameters::OmegaBundleParameter.

core::Real core::conformation::parametric::RealValuedParameter::convert_angle ( core::Real const &  val) const
inlineprivate

Ensure that an angle value is in radians.

Checks the use_degrees_ boolean. If true, converts degrees to radians; if false, returns input value.

References input_is_angle_in_degrees_, and protocols::hybridization::val.

Referenced by set_default_value(), set_perturbation_options(), set_sampling_options(), and set_value().

bool core::conformation::parametric::RealValuedParameter::copy_value_from_parameter ( ParameterCOP  other_parameter,
ParametersCOP  other_parameter_collection,
ParametersCOP  this_parameter_collection 
)
overridevirtual

Given another parameter of the same type, copy its value. This does not set value_set_ to true.

Performs type checking in debug mode.

Returns
Returns TRUE for failure, FALSE for success.

Implements core::conformation::parametric::Parameter.

Reimplemented in protocols::helical_bundle::parameters::OmegaBundleParameter.

References value_.

Referenced by protocols::helical_bundle::parameters::OmegaBundleParameter::copy_value_from_parameter().

void core::conformation::parametric::RealValuedParameter::correct_range ( )
private

If this is a parameter storing an angle, correct the value to be (-Pi:Pi]. Also, check that the value is positive if it is meant to be, or nonnegative if it is meant to be.

Also checks sampling and perturbing options to ensure that these are reasonable.

References core::conformation::parametric::Parameter::parameter_type(), perturbation_magnitude_, perturbation_type_, core::conformation::parametric::PT_angle, core::conformation::parametric::PT_generic_nonnegative_valued_real, core::conformation::parametric::PT_generic_positive_valued_real, core::conformation::parametric::RPT_end_of_list, core::id::swap(), value_, value_max_, and value_min_.

Referenced by set_default_value(), set_parameter_type(), set_perturbation_options(), set_sampling_options(), and set_value().

core::Real const& core::conformation::parametric::RealValuedParameter::default_value ( ) const
inline

Get the default value of this parameter.

References default_value_.

Referenced by provide_xsd_setting_information(), and reset_value_settings().

core::Real core::conformation::parametric::RealValuedParameter::generate_perturbed_value ( core::Real const &  current_value) const
bool core::conformation::parametric::RealValuedParameter::parse_grid_sampling_options ( utility::tag::TagCOP  tag)
private

Parse a sampling range for this parameter (e.g. r0_min="12.3" r0_max="14.3" r0_samples="5").

Returns false if none of these parameters is provided.

References core::conformation::parametric::Parameter::parameter_name(), and set_sampling_options().

Referenced by parse_setting().

bool core::conformation::parametric::RealValuedParameter::parse_perturbation_options ( utility::tag::TagCOP  tag)
private

Parse perturbation options for this parameter (e.g. r0_perturbation="5.0" r0_perturbation_type="gaussian").

Returns false if the _perturbation option is not provided.

References core::conformation::parametric::Parameter::parameter_name(), perturbation_type_, perturbation_type_string_from_enum(), and set_perturbation_options().

Referenced by parse_setting().

void core::conformation::parametric::RealValuedParameter::parse_setting ( utility::tag::TagCOP  tag,
bool const  parse_setting,
bool const  parse_grid_sampling,
bool const  parse_perturbation,
bool const  parse_copying 
)
overridevirtual

Given a tag, parse out the setting for this parameter.

If parse_setting is true, this tries to parse the value for this parameter. If parse_grid_sampling is true, this tries to parse a range of values to sample, and a number of samples. If parse_perturbation is true, this parses options for perturbing the value of the parameter. Note that, if multiple options are true, grid sampling or perturbation options are given priority over a flat setting (and an error is thrown if more than one of these is provided).

Note
Must be implemented by derived classes.

Implements core::conformation::parametric::Parameter.

References parse_grid_sampling_options(), parse_perturbation_options(), and parse_setting_only().

bool core::conformation::parametric::RealValuedParameter::parse_setting_only ( utility::tag::TagCOP  tag,
bool const  parse_copying_too 
)
protectedvirtual
core::Real const& core::conformation::parametric::RealValuedParameter::perturbation_magnitude ( ) const
inline

Get the perturbation magnitude of this parameter.

References perturbation_magnitude_.

bool core::conformation::parametric::RealValuedParameter::perturbation_set ( ) const
inline

Has the perturbation information for this parameter been set?

References perturbation_set_.

RealPerturbationType core::conformation::parametric::RealValuedParameter::perturbation_type ( ) const
inline

Get the perturbation type.

References perturbation_type_.

RealPerturbationType core::conformation::parametric::RealValuedParameter::perturbation_type_enum_from_string ( std::string const &  type_string)
static
std::string const & core::conformation::parametric::RealValuedParameter::perturbation_type_string_from_enum ( RealPerturbationType const  type_enum)
static

Given a perturbation type enum, get the string for that enum.

Throws an error for an invalid enum.

References core::conformation::parametric::RPT_end_of_list.

Referenced by parse_perturbation_options(), and perturbation_type_enum_from_string().

void core::conformation::parametric::RealValuedParameter::provide_xsd_copying_information ( utility::tag::AttributeList &  xsd) const
private

Return the XSD information for copying this parameter from another.

References core::conformation::parametric::Parameter::copy_suffix(), and core::conformation::parametric::Parameter::parameter_name().

Referenced by provide_xsd_information().

void core::conformation::parametric::RealValuedParameter::provide_xsd_grid_sampling_information ( utility::tag::AttributeList &  xsd) const
private

Return the XSD information for grid-sampling this parameter.

References core::conformation::parametric::Parameter::parameter_name().

Referenced by provide_xsd_information().

void core::conformation::parametric::RealValuedParameter::provide_xsd_information ( utility::tag::AttributeList &  xsd,
bool const  provide_setting,
bool const  provide_copying,
bool const  provide_grid_sampling,
bool const  provide_perturbation 
) const
overridevirtual
void core::conformation::parametric::RealValuedParameter::provide_xsd_perturbation_information ( utility::tag::AttributeList &  xsd) const
private

Return the XSD information for perturbing this parameter.

References core::conformation::parametric::Parameter::parameter_name().

Referenced by provide_xsd_information().

void core::conformation::parametric::RealValuedParameter::provide_xsd_setting_information ( utility::tag::AttributeList &  xsd) const
private
void core::conformation::parametric::RealValuedParameter::reset_sampling_and_perturbation_settings ( )
overridevirtual
void core::conformation::parametric::RealValuedParameter::reset_value_settings ( )
overridevirtual
bool core::conformation::parametric::RealValuedParameter::sampling_set ( ) const
inline

Has the sampling information for this parameter been set?

References sampling_set_.

void core::conformation::parametric::RealValuedParameter::set_copy_information ( utility::tag::TagCOP  tag)
protected
void core::conformation::parametric::RealValuedParameter::set_default_value ( core::Real const &  value_in)

Sets the initial value of this parameter, keeping the value_set_ boolean false.

Also sets default_value_.

References convert_angle(), correct_range(), default_value_, default_value_was_set_, value_, and core::conformation::parametric::Parameter::value_was_set().

void core::conformation::parametric::RealValuedParameter::set_input_is_angle_in_degrees ( bool const  setting)

Set whether this parameter expects that its input is an angle in degrees.

Must be set before any values are set.

References default_value_was_set_, input_is_angle_in_degrees_, perturbation_set_, sampling_set_, and core::conformation::parametric::Parameter::value_was_set().

void core::conformation::parametric::RealValuedParameter::set_parameter_type ( ParameterType const  type_in)
overridevirtual
void core::conformation::parametric::RealValuedParameter::set_perturbation_options ( core::Real const &  pert_magnitude_in,
std::string const &  pert_type_in 
)

Set the options for perturbing this parameter (with perturbation type set by string).

References perturbation_type_enum_from_string().

Referenced by parse_perturbation_options().

void core::conformation::parametric::RealValuedParameter::set_perturbation_options ( core::Real const &  pert_magnitude_in,
RealPerturbationType const  pert_type_in 
)
void core::conformation::parametric::RealValuedParameter::set_perturbation_type ( std::string const &  pert_type_in)

Set the perturbation type, by string.

Throws an error if not a valid type.

References perturbation_type_enum_from_string().

void core::conformation::parametric::RealValuedParameter::set_perturbation_type ( RealPerturbationType const  pert_type_in)

Set the perturbation type, by enum.

Throws an error if invalid enum.

References perturbation_type_, and core::conformation::parametric::RPT_unknown_type.

void core::conformation::parametric::RealValuedParameter::set_sampling_options ( core::Real const &  value_min_in,
core::Real const &  value_max_in,
core::Size const  samples_in 
)
void core::conformation::parametric::RealValuedParameter::set_value ( core::Real const &  value_in,
bool const  ignore_use_degrees = false 
)

Set the value of this parameter.

If ignore_use_degrees is true, this will just set the value to the input value. Otherwise, it convert from degrees to radians if input_is_angle_in_degrees_ is true.

Note
This makes the value_set_ boolean true.
This makes the value_set_ boolean true.

References convert_angle(), correct_range(), core::conformation::parametric::Parameter::set_value_was_set(), and value_.

Referenced by protocols::helical_bundle::parameters::OmegaBundleParameter::parse_setting_only(), parse_setting_only(), and reset_value_settings().

void core::conformation::parametric::RealValuedParameter::set_value_sneakily ( core::Real const &  value_in)
protected

Set the value without setting value_was_set_ = true.

References value_.

Referenced by protocols::helical_bundle::parameters::OmegaBundleParameter::copy_pitch_from_parameter().

core::Real const& core::conformation::parametric::RealValuedParameter::value ( ) const
inline

Get the value of this parameter.

References value_.

Referenced by protocols::helical_bundle::parameters::OmegaBundleParameter::copy_pitch_from_parameter().

core::Real const& core::conformation::parametric::RealValuedParameter::value_max ( ) const
inline

Get the maximum value of this parameter.

References value_max_.

core::Real const& core::conformation::parametric::RealValuedParameter::value_min ( ) const
inline

Get the minimum value of this parameter.

References value_min_.

core::Size core::conformation::parametric::RealValuedParameter::value_samples ( ) const
inline

Get the samples.

References value_samples_.

Member Data Documentation

core::Real core::conformation::parametric::RealValuedParameter::default_value_
private

The default value of this parameter.

Referenced by default_value(), and set_default_value().

bool core::conformation::parametric::RealValuedParameter::default_value_was_set_
private

Has the default value been set?

Referenced by set_default_value(), and set_input_is_angle_in_degrees().

bool core::conformation::parametric::RealValuedParameter::input_is_angle_in_degrees_
private

Does this parameter expect that its input will be an angle in degrees?

Will be converted to radians internally, in this case.

Referenced by convert_angle(), and set_input_is_angle_in_degrees().

core::Real core::conformation::parametric::RealValuedParameter::perturbation_magnitude_
private
bool core::conformation::parametric::RealValuedParameter::perturbation_set_
private
RealPerturbationType core::conformation::parametric::RealValuedParameter::perturbation_type_
private
bool core::conformation::parametric::RealValuedParameter::sampling_set_
private
core::Real core::conformation::parametric::RealValuedParameter::value_
private
core::Real core::conformation::parametric::RealValuedParameter::value_max_
private

The max value to be sampled for this parameter.

Referenced by correct_range(), reset_sampling_and_perturbation_settings(), set_sampling_options(), and value_max().

core::Real core::conformation::parametric::RealValuedParameter::value_min_
private

The min value to be sampled for this parameter.

Referenced by correct_range(), reset_sampling_and_perturbation_settings(), set_sampling_options(), and value_min().

core::Size core::conformation::parametric::RealValuedParameter::value_samples_
private

The number of samples for this parameter.

Referenced by reset_sampling_and_perturbation_settings(), set_sampling_options(), and value_samples().


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