bamboo.dht.fssim
Class Algorithm

java.lang.Object
  extended by bamboo.dht.fssim.Algorithm
Direct Known Subclasses:
ContinuousAlgorithm, FairCommitmentAlgorithm, FairRateAlgorithm, FairStorageAlgorithm, NoQueuingAlgorithm, RandomAlgorithm, VirtualTimeAlgorithm

public abstract class Algorithm
extends Object


Nested Class Summary
protected static class Algorithm.PutInfo
           
static interface Algorithm.PutResultCb
           
 
Field Summary
protected  int client_count
           
static Algorithm instance
           
protected  LinkedList pending_puts
           
protected  long period
           
protected  Simulator sim
           
protected  long stop_time
           
protected  HashMap storage_by_client
           
protected  long total_puts
           
 
Constructor Summary
Algorithm(long p, long t)
           
 
Method Summary
protected  void accept_put(Algorithm.PutInfo pi)
           
protected  void all_puts_expired(int client)
           
 void enqueue_put(int client, int size, int ttl_sec, Algorithm.PutResultCb cb, Object user_data)
           
 void print_usage()
           
abstract  void process_pending_puts(LinkedList puts)
           
protected  void remove_put(Algorithm.PutInfo pi)
           
 void simulation_finished()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static Algorithm instance

pending_puts

protected LinkedList pending_puts

sim

protected Simulator sim

period

protected long period

stop_time

protected long stop_time

storage_by_client

protected HashMap storage_by_client

total_puts

protected long total_puts

client_count

protected int client_count
Constructor Detail

Algorithm

public Algorithm(long p,
                 long t)
Method Detail

enqueue_put

public void enqueue_put(int client,
                        int size,
                        int ttl_sec,
                        Algorithm.PutResultCb cb,
                        Object user_data)

remove_put

protected void remove_put(Algorithm.PutInfo pi)

all_puts_expired

protected void all_puts_expired(int client)

accept_put

protected void accept_put(Algorithm.PutInfo pi)

print_usage

public void print_usage()

process_pending_puts

public abstract void process_pending_puts(LinkedList puts)

simulation_finished

public void simulation_finished()