% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/planning.R
\name{score_economic_viability}
\alias{score_economic_viability}
\title{Score economic viability for aquaculture or restoration}
\usage{
score_economic_viability(
  result,
  harbours = NULL,
  target = c("restoration", "aquaculture"),
  verbose = TRUE
)
}
\arguments{
\item{result}{Dataframe from \code{\link[=assess_gear_feasibility]{assess_gear_feasibility()}} (which itself
requires \code{\link[=predict_oyster]{predict_oyster()}} output). Optionally also run
\code{\link[=analyse_connectivity]{analyse_connectivity()}} first to enable area scoring.}

\item{harbours}{Dataframe or NULL. Known harbour/landing locations with
\code{lat} and \code{lon} columns. Used to score site accessibility.}

\item{target}{Character. \code{"restoration"} (default) weights ecological
suitability and connectivity higher. \code{"aquaculture"} weights gear
feasibility and economic access higher.}

\item{verbose}{Logical. Print viability summary (default TRUE).}
}
\value{
Input dataframe with \code{viability_score} [0-1],
\code{viability_class} (Poor/Fair/Good/Excellent), and \code{viability_notes}.
}
\description{
Combines ecological suitability, gear feasibility, site accessibility, and
patch size into a composite \strong{economic viability index} [0-1]. This is a
heuristic scoring -- not a financial model -- but it ranks sites consistently
and can be used to shortlist candidates for detailed business case
development.

The index weighs four components:
\enumerate{
\item \strong{Ecological suitability} (40\%) -- from \code{\link[=predict_oyster]{predict_oyster()}}
\item \strong{Gear feasibility} (25\%) -- best gear score from \code{\link[=assess_gear_feasibility]{assess_gear_feasibility()}}
\item \strong{Accessible patch area} (20\%) -- log-scaled area of connected suitable
habitat (from \code{\link[=analyse_connectivity]{analyse_connectivity()}} if available)
\item \strong{Access score} (15\%) -- distance to nearest harbour/port (if
\code{harbours} table supplied) or flat 0.5 if unknown
}
}
\examples{
\donttest{
result <- predict_oyster(survey, "ostrea_edulis")
result <- assess_gear_feasibility(result)
result <- analyse_connectivity(result)

harbours <- data.frame(
  name = c("Tarbert","Portavadie"),
  lat  = c(55.865, 55.875),
  lon  = c(-5.425, -5.300)
)

result <- score_economic_viability(result, harbours = harbours,
                                    target = "aquaculture")

# Best aquaculture candidates
subset(result, viability_class \%in\% c("Good","Excellent"))
}
}
