Lightweight Bartering Grid

lbg.peer.strategy.scheduling.consumption
Class RandomConsumptionScheduling

java.lang.Object
  extended by lbg.peer.strategy.scheduling.consumption.CommonConsumptionScheduling
      extended by lbg.peer.strategy.scheduling.consumption.RandomConsumptionScheduling
All Implemented Interfaces:
ConsumptionSchedulingPolicy

public class RandomConsumptionScheduling
extends CommonConsumptionScheduling
implements ConsumptionSchedulingPolicy

Random use of Consumption Grants.

Author:
Cyril Briquet

Constructor Summary
RandomConsumptionScheduling(Peer managed_peer, Scheduler scheduler)
           
 
Method Summary
protected  LocalQueueCursor getLocalQueueCursor()
          Local Queue Cursor accessor.
protected  Ranking rankSuppliers(ConsumptionGrantsContainer c_g, RequestContainer rc)
          Rank Suppliers.
 int scheduleConsumptionTasks()
          ConsumptionSchedulingPolicy implementation.
 java.lang.String toString()
           
 
Methods inherited from class lbg.peer.strategy.scheduling.consumption.CommonConsumptionScheduling
assertConsumptionGrantsAvailability, scheduleFirstConsumptionTask, scheduleNextConsumptionTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomConsumptionScheduling

public RandomConsumptionScheduling(Peer managed_peer,
                                   Scheduler scheduler)
                            throws GridException
Throws:
GridException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class CommonConsumptionScheduling

scheduleConsumptionTasks

public int scheduleConsumptionTasks()
                             throws GridException
ConsumptionSchedulingPolicy implementation.

Specified by:
scheduleConsumptionTasks in interface ConsumptionSchedulingPolicy
Overrides:
scheduleConsumptionTasks in class CommonConsumptionScheduling
Returns:
number of successfully scheduled Consumption Tasks
Throws:
GridException - if an error occurs while using Consumption Grants to schedule Consumption Tasks

rankSuppliers

protected Ranking rankSuppliers(ConsumptionGrantsContainer c_g,
                                RequestContainer rc)
                         throws GridException
Rank Suppliers.

Note: dummy implementation.

Specified by:
rankSuppliers in class CommonConsumptionScheduling
Parameters:
c_g - collected Consumption Grants container
rc - target Task container
Returns:
null
Throws:
GridException - if a problem occured while ranking Suppliers

getLocalQueueCursor

protected LocalQueueCursor getLocalQueueCursor()
Local Queue Cursor accessor.

Note: dummy implementation.

Specified by:
getLocalQueueCursor in class CommonConsumptionScheduling
Returns:
null

Lightweight Bartering Grid

Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.