Variant¶
- class hoomd.variant.Variant¶
Variant base class.
Provides methods common to all variants and a base class for user-defined variants.
Subclasses should override the
__call__
,_min
, and_max
methods and must explicitly call the base class constructor in__init__
:class CustomVariant(hoomd.variant.Variant): def __init__(self): hoomd.variant.Variant.__init__(self) def __call__(self, timestep): return float(timestep) ** (1 / 2) def _min(self): return 0.0 def _max(self): return float("inf")
Note
Provide the minimum and maximum values in the
_min
and_max
methods respectively.- __call__(timestep)¶
Evaluate the function.
- __getstate__()¶
Get the variant’s
__dict__
attribute.
- __setstate__(state)¶
Restore the state of the variant.
- property max¶
The maximum value of this variant for \(t \in [0,\infty)\).
- property min¶
The minimum value of this variant for \(t \in [0,\infty)\).