votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::WaitingTimeStrategy Class Referenceabstract

How a carrier's next hop is drawn: the waiting time and the destination. The pluggable part of the KMC engine (KMCEngine). More...

#include <kmcwaitingtime.h>

Inheritance diagram for votca::xtp::WaitingTimeStrategy:

Public Member Functions

virtual ~WaitingTimeStrategy ()=default
virtual std::string Name () const =0
virtual void Prepare (const TimeDependentRates &rates)=0
virtual double NextTime (Index site, double t, KMCRandom &random) const =0
virtual Index ChooseHop (Index site, double t, KMCRandom &random) const =0

Detailed Description

How a carrier's next hop is drawn: the waiting time and the destination. The pluggable part of the KMC engine (KMCEngine).

Every carrier has its own clock. The engine asks NextTime() for the time of the carrier's next candidate event; at that time it asks ChooseHop() for the edge, which may return -1 (a null event, e.g. a rejected thinning proposal). If the chosen destination is occupied by another carrier the engine also treats the event as a null event. After every event of a carrier (hop or null) the engine asks NextTime() again from the event time; the clocks of the other carriers are not touched.

This is exact if, for a carrier on site i, the candidate events form a (possibly time-inhomogeneous) Poisson process with intensity c_i(t) and ChooseHop returns edge e with probability w_e(t)/c_i(t), w the rates of the TimeDependentRates, c_i(t) >= sum_e w_e(t). Exclusion then enters only through the rejected events, which is why strategies use the full escape rates of the sites and never look at the occupation.

Contract for implementations:

  • Prepare() is called once, before any run, single threaded; put all precomputation there (e.g. integrated escape rates per site).
  • NextTime() and ChooseHop() are const and called concurrently from several runs; all randomness must come from the KMCRandom passed in, so that runs are reproducible.
  • NextTime() returns a time > t (or +infinity if the carrier can never move again).

Implemented: ExponentialWaitingTime (static rates), ThinningWaitingTime (any rates with upper bounds). Template for the integrated-rate inversion for periodic rates (Prados, Brey, Sanchez-Rey, J. Stat. Phys. 89, 709 (1997); R. Paiders, BEP TU/e 2025): IntegratedRateInversion.

Definition at line 69 of file kmcwaitingtime.h.

Constructor & Destructor Documentation

◆ ~WaitingTimeStrategy()

virtual votca::xtp::WaitingTimeStrategy::~WaitingTimeStrategy ( )
virtualdefault

Member Function Documentation

◆ ChooseHop()

virtual Index votca::xtp::WaitingTimeStrategy::ChooseHop ( Index site,
double t,
KMCRandom & random ) const
pure virtual

◆ Name()

virtual std::string votca::xtp::WaitingTimeStrategy::Name ( ) const
pure virtual

◆ NextTime()

virtual double votca::xtp::WaitingTimeStrategy::NextTime ( Index site,
double t,
KMCRandom & random ) const
pure virtual

◆ Prepare()

virtual void votca::xtp::WaitingTimeStrategy::Prepare ( const TimeDependentRates & rates)
pure virtual

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