Lightweight Bartering Grid

lbg.peer.strategy.accounting
Class OGPerfectAccountant

java.lang.Object
  extended by lbg.peer.strategy.accounting.OGPerfectAccountant
All Implemented Interfaces:
BarteringAccountantPolicy

public class OGPerfectAccountant
extends java.lang.Object
implements BarteringAccountantPolicy

Note: this perfect accounting implementation (in the sense of OurGrid) is correct only in stable environments, i.e. supplied power is constant over time (when supplied, of course).

Implementation note: this implementation relies on Task output information.

Author:
Cyril Briquet

Constructor Summary
OGPerfectAccountant(Peer managed_peer)
          Constructs a new OGPerfectAccountant (SIM_MODE only).
 
Method Summary
 double evaluateConsumption(Task t, long xstart_time)
          BarteringAccountant implementation.
 double evaluateSupplying(Task t, long xstart_time)
          BarteringAccountant implementation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OGPerfectAccountant

public OGPerfectAccountant(Peer managed_peer)
                    throws GridException
Constructs a new OGPerfectAccountant (SIM_MODE only).

Throws:
GridException - if a parameter is illegal
Method Detail

toString

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

evaluateSupplying

public double evaluateSupplying(Task t,
                                long xstart_time)
                         throws GridException
BarteringAccountant implementation.

Specified by:
evaluateSupplying in interface BarteringAccountantPolicy
Throws:
GridException

evaluateConsumption

public double evaluateConsumption(Task t,
                                  long xstart_time)
                           throws GridException
BarteringAccountant implementation.

Specified by:
evaluateConsumption in interface BarteringAccountantPolicy
Throws:
GridException

Lightweight Bartering Grid

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