File: stochasticProcessSSRV.h

package info (click to toggle)
fastml 3.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,772 kB
  • sloc: cpp: 48,522; perl: 3,588; ansic: 819; makefile: 386; python: 83; sh: 55
file content (48 lines) | stat: -rw-r--r-- 2,107 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 	$Id: stochasticProcessSSRV.h 1923 2007-04-04 16:38:14Z privmane $	


#ifndef ___STOCHASTIC_PROCESS_SSRV
#define ___STOCHASTIC_PROCESS_SSRV

#include "stochasticProcess.h"
#include "replacementModelSSRV.h"

// This is a Stochastic process that its distribution is located inside its accelerator.
// _dist should be NULL all the time.
// The number of categories is always 1.
// _pijAccelerator must contain a replacementModelSSRV* as a member.
// The distribution is located inside the replacement model which is a member of _pijAccelerator.

class stochasticProcessSSRV : public stochasticProcess{
public:
	explicit stochasticProcessSSRV(const pijAccelerator *pijAccelerator) : 
		stochasticProcess() { _pijAccelerator = pijAccelerator->clone();}
	explicit stochasticProcessSSRV() : stochasticProcess() {}
	stochasticProcessSSRV(const stochasticProcessSSRV& other) : stochasticProcess(other) {}
	stochasticProcessSSRV& operator=(const stochasticProcessSSRV &other) {stochasticProcess::operator=(other); return (*this);}
	virtual stochasticProcess* clone() const {return new stochasticProcessSSRV(*this);}
	
	virtual ~stochasticProcessSSRV() {}
	
	virtual const int categories() const { return 1; }
	virtual const MDOUBLE rates(const int i) const {return 1.0;}  
	virtual const MDOUBLE ratesProb(const int i) const {return 1.0;} 

	virtual const MDOUBLE Pij_t(const int i, const int j, const MDOUBLE t) const {
		// as opposed to normal stochastic-process. even when t=0 and i!=j the result might be > 0
		return _pijAccelerator->Pij_t(i,j,t); 
	}
	
	virtual distribution* distr() const; // @@@@ this const is a lie !!!
	virtual void setDistribution(const distribution* in_distr);
	
 	virtual void setGlobalRate(const MDOUBLE x) {distr()->setGlobalRate(x);} // @@@@ should this also call updateQ of the RM ??? Doesn't really metter when using gamma distribution
 	virtual MDOUBLE getGlobalRate() const {return distr()->getGlobalRate();}

	void setRateOfRate(MDOUBLE rateOfRate) { 
		static_cast<replacementModelSSRV*>(_pijAccelerator->getReplacementModel())
			->setRateOfRate(rateOfRate);
	}
};

#endif