Ignore:
Timestamp:
10/11/12 09:07:11 (13 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r493 r497  
    66import eduni.simjava.Sim_system; 
    77import gridsim.Accumulator; 
     8import gridsim.GridSimTags; 
    89import gridsim.ResourceCalendar; 
    910import gridsim.dcworms.DCWormsTags; 
     
    115116 
    116117                case DCWormsTags.TASK_READY_FOR_EXECUTION: 
    117                          
    118118                        ExecTask execTask = (ExecTask) ev.get_data(); 
    119119                        try { 
     
    347347                        ExecTask task = iter.next(); 
    348348                        Executable exec = (Executable)task; 
     349                        exec.setCompletionPercentage(exec.getCompletionPercentage() + 100 * timeSpan/exec.getEstimatedDuration()); 
     350                         
    349351                        UsedResourcesList usedResourcesList = exec.getUsedResources(); 
    350352                        PEUnit peUnit = (PEUnit)usedResourcesList.getLast().getResourceUnits() 
    351353                                        .get(StandardResourceUnitName.PE); 
    352  
    353354                        double load = getMIShare(timeSpan, peUnit); 
    354                         exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration()); 
    355355                        addTotalLoad(load); 
    356356                } 
     
    401401                         
    402402                        Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits(); 
    403                         double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED),  
    404                                         execTask, choosenResources, exec.getCompletionPercentage()); 
     403                        int time =  Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED),  
     404                                        execTask, choosenResources, exec.getCompletionPercentage())).intValue(); 
    405405 
    406406                        //check if the new estimated end time is equal to the previous one; if yes the continue without update 
     
    408408                                continue; 
    409409                        } 
     410                        exec.setEstimatedDuration(time); 
    410411                        ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED); 
    411412                        scheduler.sim_cancel(filter, null); 
     
    449450 
    450451                Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>(); 
    451                 ResourceManager resourceManager = this.resourceManager; 
     452                LocalResourceManager resourceManager = getResourceManager(); 
    452453                if(resourceName != null){ 
    453454                        ComputingResource resource = null; 
     
    471472                        List<ResourceUnit> availableUnits = null; 
    472473                        try { 
    473                                 availableUnits = getResourceManager().getPE(); 
     474                                availableUnits = resourceManager.getPE(); 
    474475                        } catch (ResourceException e) { 
    475476                                return null; 
Note: See TracChangeset for help on using the changeset viewer.