-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathlibrr_intracellular.h
More file actions
122 lines (93 loc) · 3.77 KB
/
Copy pathlibrr_intracellular.h
File metadata and controls
122 lines (93 loc) · 3.77 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef _RoadRunner_Intracellular_h_
#define _RoadRunner_Intracellular_h_
#include <string>
#include <map>
#include <iomanip> // for setw
#include "../../../core/PhysiCell.h"
#include "../../../core/PhysiCell_phenotype.h"
#include "../../../core/PhysiCell_cell.h"
#include "../../../modules/PhysiCell_pugixml.h"
// #include "maboss_network.h"
// #ifdef ADDON_ROADRUNNER
// These are for C
// #define STATIC_RRC
// #include "rrc_api.h"
// #include "rrc_types.h"
#include "rrc_api.h"
#include "rrc_types.h"
// #include "rrc_utilities.h"
extern "C" rrc::RRHandle createRRInstance();
// #endif
class RoadRunnerIntracellular : public PhysiCell::Intracellular
{
private:
public:
// static long counter;
std::string sbml_filename;
// bool enabled = false;
int num_rows_result_table = 1;
// double time_step = 12;
// bool discrete_time = false;
// double time_tick = 0.5;
// double scaling = 1.0;
// std::map<std::string, double> initial_values;
std::map<std::string, double> parameters;
std::map<std::string, std::string> substrate_species;
std::map<std::string, std::string> custom_data_species;
std::map<std::string, std::string> phenotype_species;
std::map<std::string, int> species_result_column_index;
rrc::RRHandle rrHandle = nullptr; // created by start(), released by the destructor
// rrc::RRVectorPtr vptr;
rrc::RRCDataPtr result = 0; // start time, end time, and number of points
double next_librr_run = 0;
RoadRunnerIntracellular();
RoadRunnerIntracellular(pugi::xml_node& node);
RoadRunnerIntracellular(RoadRunnerIntracellular* copy);
~RoadRunnerIntracellular();
// owns rrHandle, so the implicit copies would double-free it; clone() is the way to copy
RoadRunnerIntracellular( const RoadRunnerIntracellular& ) = delete;
RoadRunnerIntracellular& operator=( const RoadRunnerIntracellular& ) = delete;
// rwh: review this
Intracellular* clone()
{
// return static_cast<Intracellular*>(new RoadRunnerIntracellular(this));
RoadRunnerIntracellular* clone = new RoadRunnerIntracellular(this);
clone->sbml_filename = this->sbml_filename;
clone->substrate_species = this->substrate_species;
clone->phenotype_species = this->phenotype_species;
clone->custom_data_species = this->custom_data_species;
clone->start(); // must follow the assignments above: start() loads sbml_filename
return static_cast<Intracellular*>(clone);
}
Intracellular* getIntracellularModel()
{
std::cout << "------ librr_intracellular: getIntracellularModel called\n";
return static_cast<Intracellular*>(this);
}
void initialize_intracellular_from_pugixml(pugi::xml_node& node);
// Need 'int' return type to avoid bizarre compile errors? But 'void' to match MaBoSS.
void start();
bool need_update();
// Need 'int' return type to avoid bizarre compile errors.
void update();
void update(PhysiCell::Cell* cell, PhysiCell::Phenotype& phenotype, double dt) {
update();
update_phenotype_parameters(phenotype);
}
void inherit(PhysiCell::Cell * cell) {}
int update_phenotype_parameters(PhysiCell::Phenotype& phenotype);
int validate_PhysiCell_tokens(PhysiCell::Phenotype& phenotype);
int validate_SBML_species();
int create_custom_data_for_SBML(PhysiCell::Phenotype& phenotype);
double get_parameter_value(std::string name);
void set_parameter_value(std::string name, double value);
std::string get_state();
void display(std::ostream&os) {}
// for now, define dummy methods for these in the abstract parent class
bool has_variable(std::string name) { return false; }
bool get_boolean_variable_value(std::string name) { return false; }
void set_boolean_variable_value(std::string name, bool value) {}
void print_current_nodes() {}
static void save_libRR(std::string path, std::string index);
};
#endif