//===============================================================================
//  FEED-BACKS AMONG INBREEDING, INBREEDING DEPRESSION IN SPERM TRAITS AND SPERM
//  COMPETITION CAN DRIVE EVOLUTION OF COSTLY POLYANDRY.
//  Bocedi, G. & Reid, J.M. (2017).	Evolution.
//
//  Parameters Class: cpp file. 4th September 2017.
//===============================================================================

#include "Parameters.h"

Parameters::Parameters()
{
	//Simulation
	SimNr = 0;
	rep = 50; //replicates
	gen = 10000; //generations
	ind_int = 100; //interval for individual output
	pop_int = 100; //interval for population output
	//Landscape
	x_max = 5;
	y_max = 5;
	K = 160;
	//Traits
	nL = 1000;
	n_mu = 0.001;
	evolve = new bool[3] {true, true, true};
	L = new int[3] {20, 20, 20};
	max_loci = 0;
	for (int i = 0; i < 3; i++) {
		if (L[i] > max_loci) max_loci = L[i];
	}
	if (nL > max_loci) max_loci = nL;
	genot_var = new double[3] {0.1, 10000.0, 1.0};
	genot_mean = new double[3] {0.5, 500.0, 0.5};
	mu = new double[3] {0.001, 0.001, 0.001};
	mu_size = new double[3] {0.1, 0.1, 0.1};
	mu_means = new double[3] {0.0, 0.0, 0.0};

	a_sd.get_std(genot_var, L, evolve);// initial allelic standard deviations
	a_ms.get_means(genot_mean, L, evolve);// initial allelic means	
	alphas.get_alpha(mu_size, a_sd, evolve);//sd for the mutational effects
	
	//Inbreeding
	sc = 0.01; //homozygote effect of deleterious mutations (S)
	hh = 0.0; //dominance coefficient of the deleterious mutations

	//Mating
	fec = 8; // fecundity
	max_matings = 100; // max nr. of matings in tau time
	sex_ratio = 0.5;
	tau = 1.0; // total time for mating between the fertilization of each egg
	min_delta_tau = tau / (double)max_matings;
	fr = 0.015; // fertilization rate (Alonzo & Pizzari 2013)
	lambda = 1.0; // loaded raffle (Engqvist & Reinhold 2006)

	//Dispersal
	disp = 0.001; //emigration probability
	mean_dist = 1.5; //mean dispersal distance (assuming a cell lenght of 1)

	//Costs and trade-offs
	c_f = true; //cost on female
	c_m = true; //cost on male
	theta_res = 1.0; //optimal resource allocation to male post-copulatory processes
	omega_f = 128000.0; //(omega^2) strenght of selection on female re-mating
	omega_m = 1.0;  //(omega^2) strenght of selection on male investment in sperm traits
	beta = 0.002; //scaling factor for cost of sperm
	alpha_s = 1.0; //shape parameter for cost of sperm
}

//--------------------------------------------------------------------------------------
Parameters::~Parameters()
{
}

//--------------------------------------------------------------------------------------
