Query Cycle Simulator HEADER

qcsim
Interface InitializationManager

All Known Implementing Classes:
InitializationManagerImpl

public interface InitializationManager

This component is responsible for the initialization of various system components.

Version:
1.0
Author:
unascribed

Method Summary
 void content(int categories, int minCategories, int distribution)
          This is used to establish the desired content parameters.
 void errorFraction(double error, int type)
          This will setup the upload error fraction for a given type of peer.
 void establishCollective(java.util.Vector peers, int collective, int type)
          This method is used to establish malicious collectives.
 void goodPeerResponseSelector(int selector)
          This method will setup the method of choosing which responses each good peer chooses to download.
 void highTrustPeerCategoryPref(int pref)
          This method will setup highly trusted peers to have extra category preference.
 void maliciousPeerCategoryPref(int pref)
          This method will setup malicious peers to have extra category preference.
 PeerManager peerManager()
          This module is responsible for initializing the peer manager.
 void peers(int gp, int gpn, int mp, int mpn, int htp, int htpn)
          This function will setup the number of desired peers in the system.
 void setPeerActivity(java.util.Vector peers, int activity)
          This will setup the peer's activity during the simulation.
 Simulator simulator()
          This module is responsible for initializing the simulator.
 

Method Detail

peers

public void peers(int gp,
                  int gpn,
                  int mp,
                  int mpn,
                  int htp,
                  int htpn)
This function will setup the number of desired peers in the system.

Parameters:
gp - The number of good peers.
gpn - The number of neighbors each good peer should have.
mp - The number of malicious peers.
mpn - The number of neighbors each malicious peer should have.
htp - The number of highly trusted peers.
htpn - The number of neighbors each highly trusted peers should have.

content

public void content(int categories,
                    int minCategories,
                    int distribution)
This is used to establish the desired content parameters.

Parameters:
categories - The total number of categories in the system.
minCategories - Each peer will maintain at least this number of categories.
distribution - Specifies how files are distributed among peers.

maliciousPeerCategoryPref

public void maliciousPeerCategoryPref(int pref)
This method will setup malicious peers to have extra category preference. For example if you call this with argument Content.TOP_CATEGORY, then each malicious peer will choose from the top 1/3 most popular categories during content initialization.

Parameters:
pref - The type of preference

highTrustPeerCategoryPref

public void highTrustPeerCategoryPref(int pref)
This method will setup highly trusted peers to have extra category preference. For example if you call this with argument PeerContentManager.TOP_CATEGORY, then each highly trusted peer will choose from the top 1/3 most popular categories during content initialization.

Parameters:
pref - The type of preference

goodPeerResponseSelector

public void goodPeerResponseSelector(int selector)
This method will setup the method of choosing which responses each good peer chooses to download. For example A peer will send a query for a particular file and receive a number of responses. Setting this method to PeerBehavior.RPB_RANDOM will cause the peer to choose responses in random order.

Parameters:
selector - response selector (see PeerBehavior.RPB_*).

errorFraction

public void errorFraction(double error,
                          int type)
This will setup the upload error fraction for a given type of peer.

Parameters:
error - The fraction of time a peer makes a mistake.
type - The type of peer that has this error fraction.

setPeerActivity

public void setPeerActivity(java.util.Vector peers,
                            int activity)
This will setup the peer's activity during the simulation. See PeerBehavior.ACTIVITY_* for more information.

Parameters:
peers - A vector of peers to initialize.
activity - The activity model the peers will follow.

establishCollective

public void establishCollective(java.util.Vector peers,
                                int collective,
                                int type)
This method is used to establish malicious collectives. The vector of peers should be only malicious peers. Passing in good or highly trusted peers will be ignored.

Parameters:
peers - The peers that will be apart of the collective.
collective - The colletive type.
type - The type of configuration.

peerManager

public PeerManager peerManager()
This module is responsible for initializing the peer manager. Once the proper parameters (following a call to peers(..)) have been set you can call this method to get the peer manager.

Returns:
The peer manager (or null if not yet ready).

simulator

public Simulator simulator()
This module is responsible for initializing the simulator. Calling this method will provide that simulator.

Returns:
The system simulator.

Query Cycle Simulator HEADER