% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/summary_stockflow.R
\name{summary.stockflow}
\alias{summary.stockflow}
\title{Run model diagnostics}
\usage{
\method{summary}{stockflow}(object, ...)
}
\arguments{
\item{object}{Stock-and-flow model, object of class \code{\link{stockflow}}.}

\item{...}{Additional arguments (currently unused).}
}
\value{
Object of class \code{summary_stockflow}. A flat named list with one
entry per check. Each entry contains a \code{problem} field (\code{"none"},
\code{"warning"}, or \code{"error"}) and type-specific data fields.
}
\description{
Check for common formulation problems in a stock-and-flow model.
}
\details{
The following problems are detected:
\itemize{
\item An absence of stocks
\item Flows without a source (\code{from}) or target (\code{to})
\item Flows connected to a stock that does not exist
\item Undefined variable references in equations
\item Circularity in equations
}

The following potential problems are detected:
\itemize{
\item Absence of flows
\item Stocks without inflows or outflows
\item Equations with a value of 0
}
}
\examples{
# No issues
sfm <- stockflow("sir")
summary(sfm)

# Detect absence of stocks or flows
sfm <- stockflow()
summary(sfm)

# Detect stocks without inflows or outflows
sfm <- stockflow() |> update("Prey", "stock")
summary(sfm)

# Detect circularity in equation definitions
sfm <- stockflow() |>
  update("Prey", "stock", eqn = "Predator") |>
  update("Predator", "stock", eqn = "Prey")
summary(sfm)

}
\concept{build}
