Repository navigation
Expand file tree
/
Copy pathNSA.h
More file actions
executable file
·42 lines (32 loc) · 1.41 KB
/
Copy pathNSA.h
File metadata and controls
executable file
·42 lines (32 loc) · 1.41 KB
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
//
// Created by Malysheva, Nadezhda on 2019-07-30.
//
#ifndef ALGO_NSA_H
#define ALGO_NSA_H
#include "ContactNetwork.h"
#include <random>
class NSA
{
public:
NSA();
void execute(double tStart, double tEnd, ContactNetwork &contNetwork, NetworkStorage &nwStorage,
std::vector<double> &tInfect, const std::string &saveDegreeDistMode,
double epsilon, size_t &nRejections, size_t &nAcceptance, size_t &nThin/*,
std::vector<BenStructure> &benToFile*/);
~NSA() {};
private:
double getPropUpperLimit (double lookAheadTime, ContactNetwork & contNetwork,
double dignosisUpperLimit, double deathUpperLimit) const;
double sampleRandUni();
private:
void executeReaction(ContactNetwork & contNetwork, const std::string &reactId, double rStart,
double rBound, double time, uint32_t &nInf,
std::vector<std::pair<double, lemon::ListGraph::Edge>> &propTransmit,
std::vector<std::pair<double, lemon::ListGraph::Node>> &propDiagnos,
std::vector<std::pair<double, lemon::ListGraph::Node>> &propDeath,
std::vector<double> &tInfect,NetworkStorage &nwStorage, const std::string &saveDegreeDistMode);
std::random_device rDev;
std::mt19937_64 generator;
std::uniform_real_distribution<> randuni;
};
#endif //ALGO_NSA_H