Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
psi.h
Go to the documentation of this file.
1 
11 /*
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 
27 #ifndef PSI_H
28 
29 // Version number
30 #define myVersion 1.0
31 
32 #define PSI_H
33 
34 #define ALGO_MONOTONE 1
35 #define ALGO_NONMONOTONE 2
36 
37 
38 //EVENT structure
43 typedef struct st_evt{
44  char* name_evt;
45  int id_evt;
48  double rate;
51  int* from;
52  char** name_from;
54  void** indexFctOrigin;
58  int* to;
59  char** name_to;
61  void** indexFctDest;
63  int nb_params;
64  char** param;
65  int nb_rand;
66  int* rand_par;
67 } T_event;
68 //Event List structure
73 typedef struct st_events{
75  int nb_evts;
76 }T_events;
77 
78 //Queues structure
83 typedef struct st_queues{
84  int* mins;
85  int* maxs;
86  char** name_queues;
87  int nb_queues;
88 } T_queues;
89 
90 //Model structures
95 typedef struct st_model{
98 }T_model;
99 
100 // Output structure
105 typedef struct st_output{
107  short int showModel;
108  short int showParam;
109  short int showsimulTime;
110  void* outputFct;
111 }T_output;
112 
117 typedef struct st_state{
118  int **queues;
120  int splitting;
121 } T_state;
122 
123 
129  int num;
130  int level;
131  struct st_hier_node * father;
132  int nbsons;
133  struct st_linked_sons * sons;
134 };
140  struct st_linked_sons * next;
141  struct st_hier_node * val;
142 };
147 struct st_neighbors {
149  int * neighbors;
150 };
155 typedef struct elem{
156  int length;
158  int* index;
159 }elements;
160 
165 typedef T_state* (*T_ptr_transfct)(T_state* state, T_event* evt);
166 
167 
172 typedef short int (*T_ptr_rewardfct)(T_state* states,int log2temps_arret,int *reward,int* state_saved);
173 
174 
179 typedef short int (*T_ptr_stopfct)();
180 
185 typedef double (*T_ptr_indexfct)();
186 
191 typedef void (*T_ptr_outputfct) ();
192 
197 typedef int (*T_ptr_splitfct) ();
202 typedef T_state* (*T_ptr_splitInitfct) (T_state* state,int size);
207 typedef T_state* (*T_ptr_envelop)();
208 
209 /***************************************************************/
210 /* For Simple Forward Parallel */
211 /***************************************************************/
212 
216 typedef struct interval {
217  int id_interval;
218  int*** saved_trajectories;
219  int last_saved_trajectory;
220  int begin, length;
221  int* events_list;
222 }T_interval;
223 
227 typedef struct task_data{
228  int id_interval;
229  int* begin_state;
230  int is_master;
231  int priority;
232 }T_task_data;
233 
237 typedef struct a_task {
238  T_task_data data;
239  struct a_task* prec;
240  struct a_task* next;
241 }T_task;
242 
246 typedef struct taskpool{
247  T_task* head;
248  T_task* queue;
249  int nb_tasks;
250 }T_task_pool;
251 
256 typedef T_task* (*T_ptr_taskpopfct)(T_task_pool* taskpool);
257 
258 /******************************************************************************/
259 /* For Catch me if you can */
260 /******************************************************************************/
265 typedef struct State_Bis {
266  int* state;
267  int id;
268  struct State_Bis* next;
269 }T_State_Bis;
270 
271 
276 typedef struct Trajectorie{
277  int* trajectorie;
278  int time;
279  struct Trajectorie* next;
281 
282 
286 typedef struct Traj{
287  T_Trajectorie* trajectorie;
288  int id_young;
289  int id_old;
290  struct Traj* next;
291  struct Traj* prec;
292 }T_Traj;
293 
294 
299 typedef struct Trajpool{
300  T_Traj* head;
301  T_Traj* queues;
302 }T_Trajpool;
303 
304 
309 typedef struct Interval_Bis{
310  int id_interval;
311  T_Trajectorie* saved_trajectorie;
312  int begin;
313  int index_save_state;
315 
316 #endif //PSI_H