Exemplo n.º 1
0
void call::dequeue_call (status &state,int server) {
  set_time(state.current_time);
  state.waiting_time += get_waiting_time();
  Log_Simulation << *this << endl;
  new release (state,server,demand_point);
  delete this;
}
Exemplo n.º 2
0
float get_total_waiting_time(solution_t *soln) {
    
    job_t *jobs = soln->jobs;
    int *jobs_order = soln->jobs_order;
    int i, job_id_prev, job_id_now;
    float total = 0.0;
    
    job_id_prev = jobs_order[0];
    for(i=1; i<numnodes+1; i++) {
        job_id_now = jobs_order[i]; 
        total += get_waiting_time(job_id_prev, job_id_now, soln);
        job_id_prev = job_id_now;
    }
    return total;
}
Exemplo n.º 3
0
/* To print the details of the solution */
void print_solution(solution_t *soln) {

    job_t *jobs = soln->jobs;
    int *jobs_order = soln->jobs_order;
    int i, job_id;
    float duration; 
    
    for(i=0; i<numnodes+1; i++) {
        job_id = jobs_order[i];
        duration = jobs[job_id].end_time - jobs[job_id].start_time;
        
        printf("-----------------\n");
        printf("Job #: %d\n", job_id);
        printf("Job order: %d\n", get_job_order(job_id, soln));
        if(i > 0)
            printf("Waiting time: %f\n", get_waiting_time(jobs_order[i-1], job_id, soln));
        printf("Start Time: %f\n", get_start_time(job_id, soln));
        printf("End Time: %f\n", get_end_time(job_id, soln));
        printf("Duration: %f\n", get_duration(job_id, soln));
        printf("Lateness: %f\n", get_lateness_time(job_id, soln));
        printf("-----------------\n");
    }
}