% *Team-methods

\title{Consumer classes for directed acyclic graph evaluation}


  A \code{\linkS4class{Consumer}} to route incoming tasks through nodes
  connected as a directed acyclic graph.


DAGParam(x, ...)

DAGTeam(..., dagParam = DAGParam(), teamParam = MulticoreParam(1L))

\S3method{plot}{DAGTeam}(x, y, ...)


  \item{x}{A matrix or data.frame with columns \sQuote{From},
    \sQuote{To}, or a \code{graphNEL} object (from the graph package)
    describing a directed acyclic graph.}

  \item{...}{For \code{DAGTeam}, named \code{\link{FunctionConsumer}}
    instances, one for each node in the graph. The
    \code{FunctionConsumer} corresponding to the first node in the graph
    must accept one argument; remaining \code{FunctionConsumer}
    instances must have as input arguments the names of the nodes from
    which the inputs derive, as in the example below.

    For \code{DAGParam} when \code{x} is a data.frame or matrix,
    data.frame columns \code{W}, \code{V} or additional arguments
    \code{W}, \code{V} as described in \code{\link{ftM2graphNEL}}.


  \item{dagParam}{A \code{DAGParam} instance, with all nodes referenced
    in the graph represented by \code{\link{FunctionConsumer}} instances
    in \code{...}.}

  \item{teamParam}{A \code{ParallelParam} instance, such as generated by
    \code{MulticoreParam()}. Currently ignored (all calculations are
    performed on a single thread).}




  Use \code{DAGParam} and \code{DAGTeam} to construct instances of these
  classes, with \code{ParallelParam} instances created by, e.g.,


\section{Methods}{See \code{\link{Consumer}} Methods.}

\section{Internal Class Fields and Methods}{

  Internal fields of this class are are described with, e.g.,

  Internal methods of this class are described with
  \code{getRefClass("MulticoreTeam")$methods()} and


\author{Martin Morgan \url{mtmorgan@fhcrc.org}}


  \code{\link{Team}} applies a single function across multiple threads..


df <- data.frame(From = c("A", "A", "B", "C"),
                 To   = c("B", "C", "D", "D"),
dagParam <- DAGParam(df)
dteam <- DAGTeam(A=FunctionConsumer(function(y) y),
                 B=FunctionConsumer(function(A) -A),
                 C=FunctionConsumer(function(A) 1 / A),
                 D=FunctionConsumer(function(B, C) B + C),


strm <- Stream(Seq(to=10), dteam)
sapply(strm, c)