Ignore:
Timestamp:
10/31/12 13:52:06 (12 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/build/classes/example/localplugin/FCFS_BFLocalPlugin.java

    r477 r539  
    11package example.localplugin; 
    22 
    3 import gridsim.Gridlet; 
     3import gridsim.dcworms.DCWormsTags; 
    44import schedframe.events.scheduling.SchedulingEvent; 
    55import schedframe.scheduling.manager.resources.ResourceManager; 
    66import schedframe.scheduling.manager.tasks.JobRegistry; 
    7 import schedframe.scheduling.plan.SchedulingPlanInterface; 
    87import schedframe.scheduling.plan.impl.SchedulingPlan; 
    98import schedframe.scheduling.plugin.grid.ModuleList; 
     
    1312import schedframe.scheduling.tasks.WorkloadUnit; 
    1413 
    15 public class FCFS_BFLocalPlugin extends BaseLocalPlugin { 
     14public class FCFS_BFLocalPlugin extends BaseLocalSchedulingPlugin { 
    1615 
    17         public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
     16        public SchedulingPlan schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry, 
    1817                         ResourceManager resManager, ModuleList modules) { 
    1918 
    2019                SchedulingPlan plan = new SchedulingPlan(); 
    21                 // chose the events types to serve. 
    22                 // Different actions for different events are possible. 
     20                // Chose the events types to serve. Different actions for different events are possible. 
    2321                switch (event.getType()) { 
    2422                case START_TASK_EXECUTION: 
    2523                case TASK_FINISHED: 
    26                 //case TIMER: 
     24                         
    2725                        // our tasks are placed only in first queue (see BaseLocalPlugin.placeJobsInQueues() method) 
     26                        TaskQueue q = queues.get(0); 
    2827                         
    29                         TaskQueue q = queues.get(0); 
    3028                        // check all tasks in queue 
    3129                        for (int i = 0; i < q.size(); i++) { 
    32                                 WorkloadUnit<?> job = q.get(i); 
     30                                WorkloadUnit job = q.get(i); 
    3331                                TaskInterface<?> task = (TaskInterface<?>) job; 
    3432                                 
    3533                                // if status of the tasks in READY 
    36                                 if (task.getStatus() == Gridlet.READY) { 
     34                                if (task.getStatus() == DCWormsTags.READY) { 
    3735                                        addToSchedulingPlan(plan, task); 
    3836                                } 
     
    4341        } 
    4442 
    45         public String getName() { 
    46                 return getClass().getName(); 
    47         } 
    48  
    49  
    5043} 
    5144 
Note: See TracChangeset for help on using the changeset viewer.