fern.analysis
Class AnalysisBase

java.lang.Object
  extended by fern.analysis.AnalysisBase
Direct Known Subclasses:
AutocatalyticNetworkDetection, ShortestPath

public class AnalysisBase
extends Object

This class can be used as a base class for many analysis algorithms (like AutocatalticNetworkDetection, ShortestPath, ...). It creates adjacency lists for the molecule species (which are usually not present in Network implementing classes) and presents methods for a general breath first search and depth first search, which can be controlled by a NetworkSearchAction

Author:
Florian Erhard
See Also:
NetworkSearchAction

Constructor Summary
AnalysisBase(Network network)
          Creates an analysis instance.
 
Method Summary
 int bfs(int[] speciesSource, int[] reactionSource, NetworkSearchAction action)
          Performs a breath first search starting at the given sources (which means the contents of speciesSource and reactionSource are the initial content of the queue.
 int dfs(int[] speciesSource, int[] reactionSource, NetworkSearchAction action)
          Performs a depth first search starting at the given sources (which means the contents of speciesSource and reactionSource are the initial content of the stack.
 int search(IntSearchStructure str, int[] speciesSource, int[] reactionSource, NetworkSearchAction action)
          Performs a search starting at the given sources (which means the contents of speciesSource and reactionSource are the initial content of the search structure IntSearchStructure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisBase

public AnalysisBase(Network network)
Creates an analysis instance. In order to do that, a Network is required. If the network is a ModifierNetwork, the original network is also discovered and stored.

Parameters:
network - the network for analysis
Method Detail

bfs

public int bfs(int[] speciesSource,
               int[] reactionSource,
               NetworkSearchAction action)
Performs a breath first search starting at the given sources (which means the contents of speciesSource and reactionSource are the initial content of the queue. The search is controlled by an NetworkSearchAction.

Parameters:
speciesSource - indices of the species to start with
reactionSource - indices of the reactions to start with
action - controls what species/reactions have to be visited and what to do after discovering/finishing a species/reaction
Returns:
number of visited species/reactions

dfs

public int dfs(int[] speciesSource,
               int[] reactionSource,
               NetworkSearchAction action)
Performs a depth first search starting at the given sources (which means the contents of speciesSource and reactionSource are the initial content of the stack. The search is controlled by an NetworkSearchAction.

Parameters:
speciesSource - indices of the species to start with
reactionSource - indices of the reactions to start with
action - controls what species/reactions have to be visited and what to do after discovering/finishing a species/reaction
Returns:
number of visited species/reactions

search

public int search(IntSearchStructure str,
                  int[] speciesSource,
                  int[] reactionSource,
                  NetworkSearchAction action)
Performs a search starting at the given sources (which means the contents of speciesSource and reactionSource are the initial content of the search structure IntSearchStructure. The search is controlled by an NetworkSearchAction.

Parameters:
str - the search structure (fifo/lifo)
speciesSource - indices of the species to start with
reactionSource - indices of the reactions to start with
action - controls what species/reactions have to be visited and what to do after discovering/finishing a species/reaction
Returns:
number of visited species/reactions
See Also:
bfs(int[], int[], NetworkSearchAction), dfs(int[], int[], NetworkSearchAction)