planet.behaviour
Interface BehaviourRoleSelector
- All Known Implementing Classes:
- BehaviourRoleSelectorImpl
- public interface BehaviourRoleSelector
BehaviourRoleSelector's Interface is aimed at providing a mechanism to set the role of
each node within the overlay network. The node's role can only be determined on
behaviour's context. It uses the following several from behaviour properties file:
- ~ DEFAULT_FAULTY_NODES: percentatge of faulty nodes within the network.
- ~ DEFAULT_MALICIOUS_DISTRIBUTION: type of distribution of the faulty nodes:
- ~ BehaviourProperties.UNIFORM: faulty nodes distributed uniformaly along the
network.
- ~ BehaviourProperties.CHAIN: faulty nodes forming a continous chain of faulty
nodes.
- Author:
- Marc Sánchez
Method Summary |
java.util.Set |
select(java.util.Iterator network,
double percentage,
int distribution)
This methods selects malicious nodes from the overlay according to a percentage and
distribution of them along the network. |
select
public java.util.Set select(java.util.Iterator network,
double percentage,
int distribution)
- This methods selects malicious nodes from the overlay according to a percentage and
distribution of them along the network.
- Parameters:
network
- Iterator of all ids.percentage
- Percentage of faulty nodes.distribution
- Distribution's type of faulty nodes: chain or uniform.
- Returns:
- Returns a set with Ids of malicious nodes.
- Throws:
java.lang.ClassCastException
- if network is not a collection of id's objects.