author rtrimana Mon, 11 Jul 2016 23:47:28 +0000 (16:47 -0700) committer rtrimana Mon, 11 Jul 2016 23:47:28 +0000 (16:47 -0700)
 doc/iotcloud.tex patch | blob | history

index 3c330127a561a45ae9bd5cfd2d72a96d46362626..5cf8b641b903155b69d442579826f0aeee8c22be 100644 (file)
@@ -141,21 +141,24 @@ $slot_s = \tuple{s, sv} \in SL \subseteq SN \times SV$ \\
\end{algorithmic}\r
\r
\begin{algorithmic}[1]\r
-\Function{PutSlot}{$s',sv',max'$}\r
+\Function{PutSlot}{$s_p,sv_p,max'$}\r
\If{$(max' \neq \emptyset)$}\Comment{Resize}\r
\State $max \gets max'$\r
\EndIf\r
-\If{$(s' = s_n + d)$}\r
+\State $s_n \gets \{\langle s,sv \rangle \in SL \mid \r + \forall \langle s_i,sv_i \rangle \in SL, s \geq s_i\}$\Comment{Last s}\r
+\If{$(s_p = s_n + 1)$}\r
\If{$n = max$}\r
-               \State $SL \gets SL - \{\langle s_n,sv_n \rangle\}$\r
+               \State $SL \gets SL - \{\langle s,sv \rangle \in SL \mid \r + \forall \langle s_i,sv_i \rangle \in SL, s \leq s_i\}$\Comment{First s}\r
\Else \Comment{$n < max$}\r
\State $n \gets n + 1$\r
\EndIf\r
-    \State $SL \gets SL \cup \{\langle s',sv' \rangle\}$\r
+    \State $SL \gets SL \cup \{\langle s_p,sv_p \rangle\}$\r
\State \Return{$true$}\r
\Else\r
-       \State \Return{$(false,\{\langle i,sv_i \rangle \in SL \mid \r - s' \leq i \leq s_n\})$}\r
+       \State \Return{$(false,\{\langle s,sv \rangle \in SL \mid \r + s \geq s_p\})$}\r
\EndIf\r
\EndFunction\r
\end{algorithmic}\r