
#ifndef __TIRAGES_H__
#define __TIRAGES_H__


#include "global.h"


/******************************************************************************/
/* STRUCTURE DE LOI                                                           */
/*                                                                            */
/* Stocke le type de la loi de generation des multiplieurs, ainsi que les pa- */
/* rametres associes et notamment la densite.                                 */
/******************************************************************************/

typedef enum {
  log_normal=1,log_exponential,log_poisson
} type_loi_t;


typedef struct {
  double mu;
  double sigma2;
} log_normal_t;


typedef struct {
  double Temp;
} log_exponential_t;


typedef struct {
  double W0;
} log_poisson_t;


typedef union {
  log_normal_t ln;
  log_exponential_t le;
  log_poisson_t lp;
} parametres_t;


typedef struct {
  type_loi_t type;
  parametres_t parametres;
  double C;
} loi_t;


/******************************************************************************/
/* PROTOTYPES                                                                 */
/******************************************************************************/

double randn(void);
long zone_influence(double,double,double,long,long,double,positions_t *);
void tirer_positions(long,double,double,double,double,double,double,double,double,
                     positions_t *,long,long);
void tirer_multiplieurs(positions_t,tirage_t *,loi_t,motif_t,angle_t,
                        numero_fonction_t,long,long);


#endif

