Commit b4032fe0 authored by Alexis Lebis's avatar Alexis Lebis

Add new param for deactivating decay

parent 582f289c
......@@ -66,6 +66,7 @@ int main(int argc, char* argv[]){
CursusEval::WEIGHT_REPETION = parser.createParam((double)(1.0), "wREP", "Weight of Repetition in the fitness value", 'v', "Param").value();
CursusEval::WEIGHT_JOB = parser.createParam((double)(1.0), "wJob", "Weight of profession in the fitness value", 'w', "Param").value();
CursusEval::WEIGHT_PREREQ = parser.createParam((double)(1.0), "wPrereq", "Weight of prerequisites in the fitness value", 'W', "Param").value();
DecayEngine::IS_DECAY_DEACTIVATED = parser.createParam((int)(0), "decayDeactivated", "Wether or not the decay is deactivated", 'D', "Param").value();
//PROFESSION PARAMETERS
unsigned int JOB_SEED = parser.createParam((unsigned int)(7777), "jobSeed", "Seed used for the Profession", 'g', "Param").value();
......
......@@ -9,6 +9,7 @@ SET (EXERCICE_SOURCES
course.cpp
profession.cpp
problem.cpp
decay.cpp
)
ADD_LIBRARY(lModel STATIC ${EXERCICE_SOURCES})
......
#include "decay.h"
int DecayEngine::IS_DECAY_DEACTIVATED = 0;
\ No newline at end of file
......@@ -2,16 +2,20 @@
#define SRC_MODEL_DECAY_H_
#include <cmath>
#include <iostream>
class DecayEngine
{
private:
public:
static int IS_DECAY_DEACTIVATED;
/** Expresses the decay over the time x.
*/
static double defaultDecay(int t)
{
if(IS_DECAY_DEACTIVATED)
return 0;
if(t == 0)
return 0;
return (exp(t / 1.25) + 5)/100;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment