Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
Lets say we have an Array of *{_}N{_}* Monitoring sites *{_}AM\[1...N\]_* and each site have *{_}Mn{_}* tools *{_}T\[1..Mn\]_* to execute. Let *{_}B{_}* be the bytes received by host in token and *{_}X\[1..x\]_* represent no of target to be probed with tools.

Code Block
NextSite(A,i)
if i is equal to length_of(A) then
   return A[1]
else return A[i+1]
Code Block
ChangePriority(A){  x = A[lengthOf(A)]  for i = lengthOf(A)-1 down to 1	A[i+1] = A[i]	i = i -1  A[1] = x }  x }
Code Block

GetMaxPriorityElement(A){	return A[lengthOf(A)]}
Code Block

Schedule(M,T,X){  while isTokenRecieved() is false	 // wait 1 sec for another check  totalBytes = B				// B is the total no. of bytes received in Token  while totalBytes > 0	tool = GetHighestPriorityElement(T)	target = GetHighestPriorityElement(X)
	exec (tool,target)	totalBytes = totalbytes - tool.bytesRequired	ChangePriority(T)	ChangePriority(X)  sendToken(NextSite(M,i),B)}