
function [duration_vec,flow_vec,timestart_vec]=getProfileDetails

dist=prob_dist_shower;
shower_dist = make_prob_table(dist);
prob_dist_small_medium
small_medium_dist = make_prob_table(dist);
prob_dist_bath
bath_dist = make_prob_table(dist);


day.time = 0:1/60:24;
day.flow = zeros(length(day.time),1);

% flow types, number of incidents/day
% short,   28 
% medium,  12
% bath,    .143
% shower,  2




% generate a normal day
average_inc_pr_day = 20;

inc_today = ceil(average_inc_pr_day + 4*rand);
inc_dist = [28,12,.143,2];
inc_dist = inc_dist./sum(inc_dist);
inc_prob = cumsum(inc_dist);
inc_dist_today = [0,0,0,0];

duration_vec=[];
flow_vec=[];
timestart_vec=[];

for i = 1:inc_today
    index = find(inc_prob > rand,1);
    inc_dist_today(index) = inc_dist_today(index) + 1;
end

disp(inc_dist_today)


for i = 1:4
number_of_inc_today = inc_dist_today(i);
switch i
    case 1
        mean_flow = 1;
        std_flow = .05;
        mean_duration = 1;
        std_duration = .05;
        time_dist = small_medium_dist;
    case 2
        mean_flow = 6;
        std_flow = 1;
        mean_duration = 1;
        std_duration = .05;
        time_dist = small_medium_dist;
    case 3
        mean_flow = 14;
        std_flow = 2;
        mean_duration = 10;
        std_duration = 2;
        time_dist = bath_dist;
    case 4
        mean_flow = 8;
        std_flow = 1;
        mean_duration = 5;
        std_duration = 2;
        time_dist = shower_dist;
end;

if number_of_inc_today > 0;
    for n = 1:number_of_inc_today
        %hour of the usage
        time = time_of_usage(time_dist); %[h]
        flow = mean_flow + std_flow*randn; %l/m
        flow = max(flow,0);
        duration = mean_duration + ceil(std_duration*randn); %min
        duration=duration/60;%[now in hours]
        duration_vec=[duration_vec duration*3600]; %[in seconds]
        flow_vec=[flow_vec flow];
        timestart_vec=[timestart_vec time*3600 ];
        
    end
end
  
end
timestart_vec=sort(timestart_vec)
% stairs(day.time,day.flow)