All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ajanta.pattern.Selection

java.lang.Object
   |
   +----ajanta.pattern.Pattern
           |
           +----ajanta.pattern.PatternCollection
                   |
                   +----ajanta.pattern.Selection

public class Selection
extends PatternCollection
This emulates conditional control structure. The traversal of this pattern implies choosing one pattern from the list based on a user-defined choosePattern method. This choice could be made on basis of the agent's state or the hosts to be visited in the pattern. Strategies for making a selection could be randomized, priority-based, etc. This pattern is also useful in selecting alternate paths in case of failures, like unavailability of hosts.


Constructor Index

 o Selection()

Method Index

 o choosePattern()
It will determine the location of the next Pattern in the list by modifying value of current .
 o next(AgentEnv)
Based on a user-defined choosePattern method it find next pattern to be executed and call next on that.
 o scan()
An empty method ....can overridden in derived classes

Constructors

 o Selection
 public Selection()

Methods

 o next
 protected int next(AgentEnv host) throws UnknownHostException
Based on a user-defined choosePattern method it find next pattern to be executed and call next on that. This is performed as long as there is some patterns which has not be DONE.

Overrides:
next in class Pattern
 o scan
 protected void scan()
An empty method ....can overridden in derived classes

Overrides:
scan in class Pattern
 o choosePattern
 protected int choosePattern()
It will determine the location of the next Pattern in the list by modifying value of current . It is application specific method and should be appropraitely overridden. Currenyly it provides sequential order


All Packages  Class Hierarchy  This Package  Previous  Next  Index