## 4 The Algorithm of CDS with a Simplified Executive  
In this section, we describe the proposed algorithm for the simplified CDS applied on a fiber optic link. Algorithm 1 shows the outline of the complete one PAC procedure of a simplified CDS. In addition, Table 3 lists all the notations used in this paper.  
The algorithm is described briefly as follows:  
1. Prediction of rewards using available models or reduction of the data rate until the BER is less than the FEC-threshold.
2. Extract the exact model of the system and minimize the BER.
3. Use this model to predict the BER and internal rewards before increasing the data rate.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Notations** & **Value** \\ \hline \(K\) & The total number of environmental perception action cycles (PACs) \\ \(k\) & The current PAC number during PAC running \\ \(k^{\prime}\) & The PAC number before the current CDS steady state mode \\ \(C\) & The set of all possible actions in actions library \\ X & The set of all possible modulation state \\ \(X_{n}^{k}\) & The current transmitted symbols, at time \(n\) \\ \(\
eg k\) & The known data using for modeling \\ \(\overline{X}_{n}^{k}\) & The estimated decision by the system \\ \(Y_{n}^{k}\) & The received symbols at time \(n\) and \(k\)th PAC \\ \(\overline{Y}_{n}^{k}\) & The normalized received symbols at time \(n\) and \(k\)th PAC \\ \(\gamma_{n}^{k}\) & The discretized received symbols at time \(n\) and \(k\)th PAC \\ \(rw_{j}^{k}\) & The internal reward at time \(n\), \(j\)th data rate, and \(k\)th PAC \\ \(P(\hat{X}_{n}^{k}|\hat{Y}_{n}^{k})\) & The estimated posterior at time \(n\) and \(k\)th PAC \\ \(c_{k}\) & Current action applied on fiber optic link \\ \(FEC-threshold\) & The predefined threshold \\ \(P(X_{n}^{(k+1)}|\hat{Y}_{n}^{k})\) & The prediction using model at \(k\)th PAC \\ \(rw_{j+1}^{k+1}\) & The internal reward prediction \\ \(c_{k+1}\) & The final action for applying in (\(k\)+1)th PAC \\ \hline \hline \end{tabular}
\end{table}
Table 3: The important notation list used in this paper.  
If prediction shows lower internal reward and the BER is less than FEC-threshold, then the CDS increases the data rate.  
```
0: the observables \(\Upsilon_{n}^{k}\)
0:\(c_{k+1}\) as the final action in environmental actions mode Initialization: Pre-adaptive actions: Reduce data rate till BER<FEC-threshold Make steady state mode off, prediction mode on Probability box?\(\%=96\), threshold = 0.01, \(P=2\), \(j=1\)\(c_{k+1}\gets first\ action\ from\ C\) Apply \(c_{k^{\prime}+1}\) to the environment (fiber optic channel)
1:for\(k=(k^{\prime}+1)\ to\ K\) (see Table 3)
2: Take the observable \(\Upsilon_{n}^{k}\)
3:if the model is not available then
4:if BER > FEC-threshold then
5: Estimate \(P(\hat{X}_{n}^{k}|\hat{Y}_{n}^{k})\) using \(P(\hat{Y}_{n}^{k-1}|\hat{X}_{n}^{k-1})\)
6: Estimate \(\overline{X}_{n}^{k}\) by decision making
7:else
8: Extract the \(P(\hat{Y}_{n}^{k}|\hat{X}_{n}^{k})\) and \(P(\hat{Y}_{n}^{k})\)
9: Calculate the posterior \(P(\hat{X}_{n}^{k}|\hat{Y}_{n}^{k})\)
10: Estimate \(\overline{X}_{n}^{k}\) by decision making
11:endif
12:elseif model is available then
13: Load model, evidence and posterior from preceptor library
14: Estimate \(\overline{X}_{n}^{k}\) by decision making
15:endif
16: Send \(P\textsubscript{F}_{1}\), \(P(\hat{Y}_{n}^{k}|\hat{X}_{n}^{k})\) and \(P(\hat{Y}_{n}^{k})\) to the executive Internal reward
17: Calculate \(BER_{k}\), and \(rw_{j}^{k}\) and send it to executive Planning
18: Localize the set of all close actions to \(c_{k}\) Learning
19:Apply \(c_{k+1}\) virtually \(c_{k+1}\in\ C\)
20: Calculate \(P(X_{n}^{(k+1)}|\hat{Y}_{n}^{k})\)
21: Predict \(\overline{X}_{n}^{(k+1)}\)
22: Calculate \(BER_{k+1}\) and \(rw_{j+1}^{k+1}\)
23:if\(BER(k+1)\leq threshold\) and \(rw_{j+1}^{k+1}\geq rw_{j}^{k}\)then
24: apply \(c_{k+1}\) to the fiber link
25:\(j\gets j+1\)
26:\(k^{\prime}\gets k+1\)
27:else
28: Turn steady state on (Stay on \(c_{k}\))
29:endif
30:endfor
```  
**Algorithm 1**Environmental actions through the global feedback