-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpdp_psystem_source_random.h
158 lines (103 loc) · 3.68 KB
/
pdp_psystem_source_random.h
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*
ABCD-GPU: Simulating Population Dynamics P systems on the GPU, by DCBA
ABCD-GPU is a subproject of PMCGPU (Parallel simulators for Membrane
Computing on the GPU)
Copyright (c) 2015 Research Group on Natural Computing, Universidad de Sevilla
Dpto. Ciencias de la Computación e Inteligencia Artificial
Escuela Técnica Superior de Ingeniería Informática,
Avda. Reina Mercedes s/n, 41012 Sevilla (Spain)
Author: Miguel Ángel Martínez-del-Amor
This file is part of ABCD-GPU.
ABCD-GPU is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ABCD-GPU is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ABCD-GPU. If not, see <http://www.gnu.org/licenses/>. */
/*
* PDP_psystem_source.h
*
* Created on: 15/08/2011
* Author: miguel
*/
#ifndef PDP_PSYSTEM_SOURCE_RANDOM_H_
#define PDP_PSYSTEM_SOURCE_RANDOM_H_
#include "pdp_psystem_source.h"
#include <stdio.h>
/**********************/
/* Classes for source */
class PDP_Psystem_source_random: public PDP_Psystem_source {
public:
PDP_Psystem_source_random(Options options);
~PDP_Psystem_source_random();
private:
/* Auxiliary structures */
short int *lengthU;
short int *lengthV;
unsigned int *active_membrane;
short int *rules;
short int *lengthUp;
short int *lengthVp;
unsigned int* obj_lhs,* obj_rhs;
float * prob;
short int *env_lengthU;
/* Iterators */
unsigned int rule_block_it;
unsigned int U_it;
unsigned int V_it;
unsigned int Up_it;
unsigned int Vp_it;
unsigned int rule_it;
unsigned int block_env_it;
unsigned int rule_env_it;
unsigned int env_it;
unsigned int memb_it;
unsigned int obj_it;
public:
bool start();
unsigned int pi_loop_rule_blocks();
bool pi_next_rule_block();
char pi_lhs_charge();
unsigned int pi_lhs_membrane();
unsigned int pi_lhs_parent_membrane();
char pi_rhs_charge();
unsigned int pi_loop_lhs();
unsigned int pi_lhs_loop_U();
unsigned int pi_lhs_loop_V();
bool pi_lhs_next_object(unsigned int & object, unsigned int & multiplicity);
unsigned int pi_loop_rules();
bool pi_next_rule();
float* pi_rule_probabilities();
unsigned int pi_loop_rhs();
unsigned int pi_rhs_membrane();
unsigned int pi_rhs_loop_U();
unsigned int pi_rhs_loop_V();
bool pi_rhs_next_object(unsigned int & object, unsigned int & multiplicity);
unsigned int env_loop_rule_blocks();
bool env_next_rule_block();
unsigned int env_get_object_lhs();
unsigned int env_get_environment();
unsigned int env_loop_rules();
bool env_next_rule();
float env_get_probability();
unsigned int env_loop_rhs();
bool env_next_object(unsigned int & object, unsigned int & environment);
bool conf_loop();
unsigned int conf_loop_environments();
bool conf_next_environment();
unsigned int conf_loop_membranes();
bool conf_next_membrane();
char conf_charge_membrane();
unsigned int conf_parent_membrane();
unsigned int conf_loop_objects();
bool conf_next_object(unsigned int & object, unsigned int & multiplicity);
// In random systems, we don't generate string identificators
char ** get_objects_ids() {return NULL;}
char ** get_environments_ids() {return NULL;}
char ** get_membranes_ids() {return NULL;}
};
#endif /* PDP_PSYSTEM_SOURCE_H_ */