From: rtrimana Date: Mon, 11 Jul 2016 23:47:28 +0000 (-0700) Subject: Cleaning up PutSlot function X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c9193ea7314ed5c542c091cf4058fa4bbdc2e877;p=iotcloud.git Cleaning up PutSlot function --- diff --git a/doc/iotcloud.tex b/doc/iotcloud.tex index 3c33012..5cf8b64 100644 --- a/doc/iotcloud.tex +++ b/doc/iotcloud.tex @@ -141,21 +141,24 @@ $slot_s = \tuple{s, sv} \in SL \subseteq SN \times SV$ \\ \end{algorithmic} \begin{algorithmic}[1] -\Function{PutSlot}{$s',sv',max'$} +\Function{PutSlot}{$s_p,sv_p,max'$} \If{$(max' \neq \emptyset)$}\Comment{Resize} \State $max \gets max'$ \EndIf -\If{$(s' = s_n + d)$} +\State $s_n \gets \{\langle s,sv \rangle \in SL \mid + \forall \langle s_i,sv_i \rangle \in SL, s \geq s_i\}$\Comment{Last s} +\If{$(s_p = s_n + 1)$} \If{$n = max$} - \State $SL \gets SL - \{\langle s_n,sv_n \rangle\}$ + \State $SL \gets SL - \{\langle s,sv \rangle \in SL \mid + \forall \langle s_i,sv_i \rangle \in SL, s \leq s_i\}$\Comment{First s} \Else \Comment{$n < max$} \State $n \gets n + 1$ \EndIf - \State $SL \gets SL \cup \{\langle s',sv' \rangle\}$ + \State $SL \gets SL \cup \{\langle s_p,sv_p \rangle\}$ \State \Return{$true$} \Else - \State \Return{$(false,\{\langle i,sv_i \rangle \in SL \mid - s' \leq i \leq s_n\})$} + \State \Return{$(false,\{\langle s,sv \rangle \in SL \mid + s \geq s_p\})$} \EndIf \EndFunction \end{algorithmic}