Lightweight Bartering Grid

lbg.peer.workflow
Class TemporalTasksGrouping

java.lang.Object
  extended by lbg.peer.workflow.TemporalTasksGrouping

public class TemporalTasksGrouping
extends java.lang.Object

Implementation of the TemporalTasksGrouping heuristic, ordering Tasks of a Bag Of Tasks as sets of Tasks sharing the same input data.

Author:
Cyril Briquet

Constructor Summary
TemporalTasksGrouping()
           
 
Method Summary
static boolean areDataEqual(MetaGridData[] ds1, MetaGridData[] ds2)
          Data-Equality test between target Tasks data sets.
static long distance(MetaGridData[] ds1, MetaGridData[] ds2)
          Distance between target Tasks data sets, defined as the Storage Affinity of ds2 relative to ds1.
 Task[] groupTasks(Task[] tasks)
          Reorders a given set of Tasks with the TemporalTasksGrouping heuristic.
 Task[] groupTasksWithSingleData(Task[] tasks)
          Deprecated.  
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemporalTasksGrouping

public TemporalTasksGrouping()
                      throws GridException
Throws:
GridException
Method Detail

toString

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

groupTasksWithSingleData

@Deprecated
public Task[] groupTasksWithSingleData(Task[] tasks)
                                throws GridException
Deprecated. 

Reorders a given set of Tasks with the TemporalTasksGrouping heuristic.

Precondition: only 1 data per Task

Note: groupTasksWithSingleData() updates the ordering inside target Tasks array.

Throws:
GridException

groupTasks

public Task[] groupTasks(Task[] tasks)
                  throws GridException
Reorders a given set of Tasks with the TemporalTasksGrouping heuristic.

Note: groupTasks() updates the ordering inside target Tasks array.

Throws:
GridException

areDataEqual

public static boolean areDataEqual(MetaGridData[] ds1,
                                   MetaGridData[] ds2)
                            throws GridException
Data-Equality test between target Tasks data sets.

Parameters:
ds1 - 1st target data set
ds2 - 2nd target data set
Throws:
GridException - if a parameter is illegal

distance

public static long distance(MetaGridData[] ds1,
                            MetaGridData[] ds2)
                     throws GridException
Distance between target Tasks data sets, defined as the Storage Affinity of ds2 relative to ds1.

Note: distance(ds1,ds2) is usually not equal to distance(ds2,ds1)

Throws:
GridException

Lightweight Bartering Grid

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