% ---------------------------
\subsection{Artificial Immune Systems (AIS) in OPT}
% ---------------------------

It is useful to show how OPT-code specifications can be derived for examples of a technique that is a hybrid. 

Artificial Immune Systems (AIS) instantiate computation via biomimetic mechanisms drawn from adaptive immunity. Their operative core combines (i) population-level \emph{variation and selection} (somatic hypermutation, clonal expansion, memory) and (ii) distributed, locally interacting agents (cells, idiotypic networks), often with (iii) probabilistic fusion of uncertain signals. In OPT, this places AIS primarily in \Evo\ and \Swm, with frequent couplings to \Prb\ and occasional \Sch/\Ctl\ layers depending on task and implementation.

\paragraph{Canonical families and OPT placement.}
\begin{itemize}
  \item \textbf{Clonal selection \& affinity maturation (CLONALG, aiNet).} Population of detectors/antibodies $\{a_i\}$ undergo clone--mutate--select cycles driven by affinity to antigens $x$. OPT: \textbf{\Evo+\Swm} (often $+$\Prb).\\
  Affinity (bitstrings; Hamming distance $d_H$): $\mathrm{aff}(x,a)=1-\frac{d_H(x,a)}{|x|}$. Clone count $n_i \propto \mathrm{aff}(x,a_i)$; hypermutation rate $\mu_i=f(\mathrm{aff})$ (typically inversely proportional).
  \item \textbf{Negative Selection Algorithms (NSA).} Generate detectors that avoid ``self'' set $\mathcal S$ and cover $\mathcal X\setminus \mathcal S$. OPT: \textbf{\Evo/\Sch} ($+$\Prb\ for thresholded matching).\\
  Objective: choose $D$ s.t. $\forall d\in D: d\notin \mathcal S$ and coverage $\Pr[\mathrm{match}(x,d)\mid x\notin \mathcal S]\ge \tau$.
  \item \textbf{Immune network models (idiotypic).} Interacting clones stimulate/suppress each other; dynamics produce memory and regulation. OPT: \textbf{\Swm+\Evo} (sometimes $+$\Ctl).\\
  Skeleton dynamics: $\dot a_i=\sum_j s_{ij}a_j-\sum_j \sigma_{ij}a_ia_j-\delta a_i$ with stimulation $s_{ij}$, suppression $\sigma_{ij}$, decay $\delta$.
  \item \textbf{Dendritic Cell Algorithm (DCA) / Danger Theory.} Cells fuse PAMP/danger/safe signals to decide anomaly labeling; aggregation over a population provides robust detection. OPT: \textbf{\Swm+\Prb} (optionally $+$\Evo\ if online adaptation is added).
\end{itemize}

\paragraph{OPT-Code exemplars.}
\begin{quote}\small
\texttt{CLONALG: OPT=Evo+Swm; Rep=bitstring; Obj=affinity; Data=labels$\mid$unlabeled; Time=gens; Human=low}\\
\texttt{aiNet: OPT=Evo+Swm; Rep=realvector; Obj=affinity+diversity; Time=gens}\\
\texttt{NSA (anomaly): OPT=Evo/Sch+Prb; Rep=bitstring; Obj=coverage; Data=self/nonself; Time=gens}\\
\texttt{DCA: OPT=Swm+Prb; Rep=signals; Obj=anomaly-score; Time=online}\\
\texttt{Idiotypic control: OPT=Swm+Ctl; Rep=rules; Obj=stability+coverage; Time=online}
\end{quote}

\paragraph{Where biology and OPT coincide.}
Somatic hypermutation+$\,$selection $\to$ \Evo; massive agent concurrency and local rules $\to$ \Swm; uncertainty fusion (signal weighting, thresholds) $\to$ \Prb; homeostatic regulation $\to$ \Ctl; detector-set coverage and complement generation $\to$ \Sch.

\paragraph{Assurance considerations.}
Key failure modes are coverage gaps (missed anomalies), detector drift, and instability in network dynamics. Assurance suggests (i) held-out self/non-self tests, (ii) diversity and coverage metrics, (iii) stability analysis of interaction graphs, and (iv) calibration of anomaly thresholds (if \Prb). These layer cleanly with risk/management frameworks (NIST RMF, ISO 23053) while OPT communicates mechanism.


