meld.system.restraints.RestraintManager

class meld.system.restraints.RestraintManager(system)[source]

Bases: object

A class to manage restraints for a System

__init__(system)[source]

Initialize a RestraintManager

Parameters

system (ISystem) – the System to manage restraints for

Methods

__init__(system)

Initialize a RestraintManager

add_as_always_active(restraint)

Add a restraint as always active

add_as_always_active_list(restraint_list)

Add a list of restraints as always active

add_selectively_active_collection(rest_list, ...)

Add a selectively active collection

create_restraint(rest_type[, scaler, ramp])

Create a restraint

create_restraint_group(rest_list, num_active)

Create a restraint group

create_scaler(scaler_type, **kwargs)

Create a restraint scaler

Attributes

always_active

Always active restraints

selectively_active_collections

Selectively active collections

add_as_always_active(restraint)[source]

Add a restraint as always active

Parameters

restraint (Union[NonSelectableRestraint, SelectableRestraint]) – the restraint to add

Return type

None

add_as_always_active_list(restraint_list)[source]

Add a list of restraints as always active

Parameters

restraint_list (List[Union[NonSelectableRestraint, SelectableRestraint]]) – the restraints to add

Return type

None

add_selectively_active_collection(rest_list, num_active)[source]

Add a selectively active collection

Parameters
  • rest_list (List[Union[RestraintGroup, SelectableRestraint]]) – list of restraints or restraint groups to add

  • num_active (int) – number of active groups in collection

Return type

None

property always_active: List[Restraint]

Always active restraints

create_restraint(rest_type, scaler=None, ramp=None, **kwargs)[source]

Create a restraint

Parameters
  • rest_type (str) – type of restraint to add

  • scaler (Optional[RestraintScaler]) – scale the force with alpha

  • ramp (Optional[TimeRamp]) – scale the force over time

  • **kwargs – passed along to restraint creation functions

Return type

Restraint

create_restraint_group(rest_list, num_active)[source]

Create a restraint group

Parameters
  • rest_list (List[SelectableRestraint]) – restraints to include in group

  • num_active (int) – number of restraints active at each timestep

Return type

RestraintGroup

Returns

the new restraint group

create_scaler(scaler_type, **kwargs)[source]

Create a restraint scaler

Parameters
  • scaler_type (str) – the type a scaler to create

  • **kwargs – passed along to the scaler creattion functions

Return type

RestraintScaler

Returns

the new restraint scaler

property selectively_active_collections: List[SelectivelyActiveCollection]

Selectively active collections