Skip to content
Snippets Groups Projects
Commit eb9650bc authored by jgatt's avatar jgatt
Browse files

move comment + small code change

parent 3d42df63
Branches
Tags
1 merge request!12Merge Request multibehavior
......@@ -91,14 +91,14 @@ DMUserMultiBehavior::~DMUserMultiBehavior()
if(original_trace)
{
delete original_trace;
original_trace = NULL;
original_trace = nullptr;
}
}
void DMUserMultiBehavior::jobs_to_submit(
double date, std::list<shared_ptr<Job>> &jobs, std::list< const Profile *> &profiles)
{
DMUserRenonce::jobs_to_submit(date, jobs, profiles);
ReplayUser::jobs_to_submit(date, jobs, profiles);
}
bool DMUserMultiBehavior::C_you_later_job(double date, double next_time,shared_ptr<Job> job)
......@@ -140,6 +140,7 @@ bool DMUserMultiBehavior::red_window_behavior(double date,shared_ptr<Job> job,Pr
}
else if (behavior < red_prob_degrad + red_prob_Cyoulater + red_prob_renonce){
log_behavior(job,"consider_degrad",0);
if (job->nb_requested_resources== 1){
log_behavior(job,"rigid",0);
}
......@@ -151,6 +152,7 @@ bool DMUserMultiBehavior::red_window_behavior(double date,shared_ptr<Job> job,Pr
else if (behavior <
red_prob_degrad + red_prob_Cyoulater + red_prob_renonce + red_prob_reconfig){
log_behavior(job,"consider_reconfig",0);
if (job->nb_requested_resources == 1){
log_behavior(job,"rigid",0);
}
......@@ -178,6 +180,7 @@ bool DMUserMultiBehavior::yellow_window_behavior(shared_ptr<Job> job,Profile *pr
*/
double behavior = distribution(random_gen)*yellow_prob_total;
if (behavior < yellow_prob_reconfig){
log_behavior(job,"consider_reconfig",0);
if (job->nb_requested_resources == 1){
log_behavior(job,"rigid",0);
}
......@@ -187,6 +190,7 @@ bool DMUserMultiBehavior::yellow_window_behavior(shared_ptr<Job> job,Profile *pr
return reconfig_job(job,profile);
}
else if (behavior < yellow_prob_reconfig+yellow_prob_degrad){
log_behavior(job,"consider_degrad",0);
if (job->nb_requested_resources== 1){
log_behavior(job,"rigid",0);
}
......@@ -247,14 +251,7 @@ bool DMUserMultiBehavior::is_in_yellow_window(double date){
}
bool DMUserMultiBehavior::handle_job(double date, shared_ptr<Job> job, Profile *profile)
{
/*
* function called each time the user want to submit a job it does the following :
* - if the user is in a red window
* the user adopt the behavior define in red_window_behavior
* - if the user is in a yellow window AND not in a red one
* the user adopt the behavior define in yellow_windows_behavior
* - else the user submit it job without any change
*/
//red_windows and dm_windows check
if(is_in_red_window(date)) {
return red_window_behavior(date, job,profile);
}
......
......@@ -58,7 +58,16 @@ protected:
= std::uniform_real_distribution<double>(0.0, 1.0);
LoggerUserStat *logger = nullptr ;
bool C_you_later_job(double date, double next_time,shared_ptr<Job> job);
bool handle_job(double date,shared_ptr<Job> job,Profile *profile);
/**
* function called each time the user want to submit a job it does the following :
* - if the user is in a red window
* the user adopt the behavior define in red_window_behavior
* - if the user is in a yellow window AND not in a red one
* the user adopt the behavior define in yellow_windows_behavior
* - else the user submit it job without any change
*/
bool handle_job(double date,shared_ptr<Job> job,Profile *profile){};
bool red_window_behavior(double date,shared_ptr<Job> job, Profile *profile);
bool yellow_window_behavior(shared_ptr<Job> job, Profile *profile);
double red_prob_Cyoulater,red_prob_renonce, red_prob_reconfig,red_prob_degrad;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment