antsim.impl
Class GenericResourceDistribution

java.lang.Object
  |
  +--antsim.impl.GenericResourceDistribution
All Implemented Interfaces:
Clearable, ResourceDistribution

public class GenericResourceDistribution
extends Object
implements ResourceDistribution

Classes implementing this interface are used to generate pre-defined resources at the beginning of a simulation.

Version:
$Revision: 1.3 $
Author:
Alberto Montresor

Field Summary
static String PAR_NUMBERCOPIES
          Parameter name used to read the number of copies of the resources to be inserted in the simulated peer-to-peer network.
static String PAR_STORAGENAME
          Parameter name used to read the name of storage in which resources have to be inserted.
 
Fields inherited from interface antsim.ResourceDistribution
NAME
 
Constructor Summary
GenericResourceDistribution(Factory factory, String name)
           
 
Method Summary
 void clear()
          Restores the object to its initial state.
 void distributeResources(ResourceSet resourceSet, Peernet peernet)
          Distributes resources in a P2P network.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAR_NUMBERCOPIES

public static final String PAR_NUMBERCOPIES
Parameter name used to read the number of copies of the resources to be inserted in the simulated peer-to-peer network.

See Also:
Constant Field Values

PAR_STORAGENAME

public static final String PAR_STORAGENAME
Parameter name used to read the name of storage in which resources have to be inserted.

See Also:
Constant Field Values
Constructor Detail

GenericResourceDistribution

public GenericResourceDistribution(Factory factory,
                                   String name)
Parameters:
factory - the factory to be used to read configuration arguments and to create other configurable objects
name - the name that is associated to this instance in the configuration file
Method Detail

clear

public void clear()
Restores the object to its initial state.

Specified by:
clear in interface Clearable

distributeResources

public void distributeResources(ResourceSet resourceSet,
                                Peernet peernet)
Distributes resources in a P2P network.

Specified by:
distributeResources in interface ResourceDistribution