Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ RealValuedParameter::provide_xsd_perturbation_information(
) const {
using namespace utility::tag;
xsd + XMLSchemaAttribute::attribute_w_default( parameter_name() + "_perturbation" , xsct_real, "Perturbation magnitude for perturbing " + parameter_name() + ".", "0.0" );
xsd + XMLSchemaAttribute::attribute_w_default( parameter_name() + "_perturbation_type" , xs_string, "Perturbation type for perturbing " + parameter_name() + ". Can be \"gaussian\" or \"uniform\".", "gaussian" );
//TODO: FIGURE OUT HOW TO ADD RESTRICTION THAT THE PERTURBATION TYPE CAN ONLY BE "gaussian" OR "uniform"
xsd + XMLSchemaAttribute::attribute_w_default( parameter_name() + "_perturbation_type" , xsct_perturbation_type, "Perturbation type for perturbing " + parameter_name() + ". Can be \"gaussian\" or \"uniform\".", "gaussian" );
}

/// @brief Return the XSD information for setting this parameter.
Expand Down
8 changes: 8 additions & 0 deletions source/src/utility/tag/XMLSchemaGeneration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ std::string name_for_common_type( XMLSchemaCommonType common_type )
case xsct_task_operation_comma_separated_list : return "task_operation_comma_separated_list";
case xsct_pose_cached_task_operation : return "pose_cached_task_operation";
case xsct_string_cslist : return "string_cslist";
case xsct_perturbation_type : return "perturbation_type";
case xsct_none :
throw CREATE_EXCEPTION(utility::excn::Exception, "Error in requesting name for xsct_none;" );
break;
Expand Down Expand Up @@ -513,6 +514,13 @@ activate_common_simple_type(
string_cslist.base_type( xs_string );
string_cslist.add_restriction( xsr_pattern, "[+]?.+(,[-+]?[0-9]+)*" );
xsd.add_top_level_element( string_cslist );
} else if ( common_type == xsct_perturbation_type ) {
XMLSchemaRestriction perturbation_type;
perturbation_type.name( name_for_common_type( common_type ) );
perturbation_type.base_type( xs_string );
perturbation_type.add_restriction( xsr_enumeration, "gaussian" );
perturbation_type.add_restriction( xsr_enumeration, "uniform" );
xsd.add_top_level_element( perturbation_type );
}

/* else if ( common_type == xsct_zero_or_one ) {
Expand Down
3 changes: 2 additions & 1 deletion source/src/utility/tag/XMLSchemaGeneration.hh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ enum XMLSchemaCommonType {
xsct_packer_palette, //A single packer palette, previously defined in XML
xsct_task_operation, //A single task operation, previously defined in XML
xsct_task_operation_comma_separated_list, //A comma-separated list of task operations, all of which are previously defined in XML
xsct_pose_cached_task_operation //The identifier of a task operation stored in the datacache of a Pose object.
xsct_pose_cached_task_operation, //The identifier of a task operation stored in the datacache of a Pose object.
xsct_perturbation_type //A perturbation type: "gaussian" or "uniform"
};
std::string residue_number_string();
std::string real_regex_pattern();
Expand Down