Trial
-
class Trial
A trial contains a number of TrialStages. The Acceptance is computed as the stages are enacted, and then sent to Criteria to decide if the trial is accepted or rejected.
Subclassed by feasst::TrialAVB2Half, feasst::TrialAVB4, feasst::TrialAdd, feasst::TrialAddAVB, feasst::TrialAddAVBDivalent, feasst::TrialAddMultiple, feasst::TrialBeta, feasst::TrialFactory, feasst::TrialGibbsParticleTransferOneWay, feasst::TrialGibbsVolumeTransferOneWay, feasst::TrialGrowLinear, feasst::TrialMorph, feasst::TrialMorphExpanded, feasst::TrialMove, feasst::TrialRemove, feasst::TrialRemoveAVB, feasst::TrialRemoveAVBDivalent, feasst::TrialRemoveMultiple, feasst::TrialRotateCluster, feasst::TrialSwapSites, feasst::TrialTranslateCluster, feasst::TrialVolume
Public Functions
-
Trial(argtype args = argtype())
args:
weight: unnormalized relative probability of selection of this trial with respect to all trials (default: 1).
-
double weight() const
Return the unnormalized relative probability of selection of this trial with respect to all trials.
Add a stage which includes selection and perturbation with arguments.
Same as above, but without arguments for stage.
Set a stage, as can be done just before each attempt.
-
int num_stages() const
Number of stages.
-
const TrialStage &stage(const int index) const
Return a stage.
-
int64_t num_success() const
Number of successful attempts.
-
int64_t num_attempts() const
Number of attempts.
-
int64_t num_auto_reject() const
Number of automatic rejections.
-
void increment_num_attempts()
Increment the number of attempts for acceptance.
-
double acceptance() const
Return the ratio of the number of successful attempts and total attempts. Return -1 if no attempts were performed.
-
virtual void reset_stats()
Reset trial statistics.
-
virtual std::string status_header() const
Return the header description for the status of the trial (e.g., acceptance, etc).
-
virtual std::string status() const
Return the status of the trial (e.g., acceptance, etc).
-
virtual void precompute(Criteria *criteria, System *system)
Precompute quantities before simulation for optimization.
Set the computation of the trial and acceptance.
-
const TrialCompute &compute() const
Return TrialCompute.
-
virtual bool attempt(Criteria *criteria, System *system, Random *random)
Attempt a trial. Return true if accepted.
-
void set_description(const std::string &description)
Set the description.
-
Trial(argtype args = argtype())